InvalidArgumentException: "\string$filter" не является допустимым Fqsen с $ objectManager-> get()

Запуск модульных тестов для TYPO3 Crawler с TYPO3 10.2

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 наGeneralUtility::makeInstance() это работает, но с $objectManager->get() это не работает.

Знаю, что строчку можно убрать полностью, просто хотел понять, в чем тут проблема. Я не нахожу в этом никакой логики.

Чтобы попробовать это самостоятельно, вы можете настроить раздел require-dev в composer.json на

    "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

1 ответ

Решение

Проблема, скорее всего, в CrawelerController. ВObjectManager анализирует класс, который необходимо создать, и все зависимые классы.

В этом случае в блоке документов есть ошибка формата:https://github.com/AOEpeople/crawler/blob/typo3v9/Classes/Controller/CrawlerController.php

/**
 * Return array of records from crawler queue for input page ID
 *
 * @param integer $id Page ID for which to look up log entries.
 * @param string$filter Filter: "all" => all entries, "pending" => all that is not yet run, "finished" => all complete ones
 * @param boolean $doFlush If TRUE, then entries selected at DELETED(!) instead of selected!
 * @param boolean $doFullFlush
 * @param integer $itemsPerPage Limit the amount of entries per page default is 10
 * @return array
 */
public function getLogEntriesForPageId($id, $filter = '', $doFlush = false, $doFullFlush = false, $itemsPerPage = 10)

Между string$filter

Другие вопросы по тегам