使用 TYPO3 10.2 运行 TYPO3 爬虫的单元测试
TYPO3_PATH_WEB=$PWD/.Build/Web typo3DatabaseName=crawler typo3DatabaseHost=127.0.0.1 typo3DatabaseUsername=root typo3DatabasePassword=root .Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml Tests/Functional --filter canCreateQueueEntriesUsingConfigurationRecord
我收到以下错误,请参见下文。
如果我将https://github.com/AOEpeople/crawler/blob/typo3v9/Classes/Api/CrawlerApi.php#L76更改
为GeneralUtility::makeInstance()
它可以工作,但它$objectManager->get()
不起作用。
我知道可以完全删除该行,只是想了解这里的问题所在。我在其中找不到任何逻辑。
要亲自尝试,您可以将 composer.json 中的 require-dev 部分调整为
"require-dev": {
"nimut/testing-framework": "^4.1 || dev-master",
"nimut/typo3-complete": "^9.5 || ^10.2",
"phpstan/phpstan": "^0.11.19",
"rector/rector": "^0.6",
"symplify/easy-coding-standard": "^7.0"
},
错误
There was 1 error:
1) AOE\Crawler\Tests\Functional\Api\CrawlerApiTest::canCreateQueueEntriesUsingConfigurationRecord
InvalidArgumentException: "\string$filter" is not a valid Fqsen!.
/path/to/extension/crawler/.Build/vendor/phpdocumentor/reflection-common/src/Fqsen.php:48
/path/to/extension/crawler/.Build/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php:70
/path/to/extension/crawler/.Build/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php:32
/path/to/extension/crawler/.Build/vendor/phpdocumentor/type-resolver/src/TypeResolver.php:264
/path/to/extension/crawler/.Build/vendor/phpdocumentor/type-resolver/src/TypeResolver.php:118
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php:401
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php:185
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php:112
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php:99
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/Container/Container.php:158
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/Container/Container.php:110
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/ObjectManager.php:126
/path/to/extension/crawler/Classes/Api/CrawlerApi.php:76
/path/to/extension/crawler/.Build/Web/typo3/sysext/core/Classes/Utility/GeneralUtility.php:3461
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/Container/Container.php:193
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/Container/Container.php:166
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/Container/Container.php:110
/path/to/extension/crawler/.Build/Web/typo3/sysext/extbase/Classes/Object/ObjectManager.php:126
/path/to/extension/crawler/Tests/Functional/Api/CrawlerApiTest.php:116