b13 / menus

TYPO3 Extension for creating fast menus in a fast fashion
GNU General Public License v2.0
54 stars 22 forks source link

Unit tests are broken #53

Closed sbuerk closed 3 years ago

sbuerk commented 3 years ago

Unit tests are broken, and throwing 1 error and 2 failures:

Creating network "local_default" with the default driver
PHP 7.2.34-18+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb 23 2021 15:08:03) ( NTS )
PHPUnit 8.5.17 by Sebastian Bergmann and contributors.

.FFE..                                                              6 / 6 (100%)

Time: 89 ms, Memory: 28.01 MB

There was 1 error:

1) B13\Menus\Tests\Unit\Domain\Repository\MenuRepositoryTest::getBreadcrumbsMenuRespectConfiguredExcludeDoktypes
Undefined index: nav_hide

/var/www/work/typo3-play/packages/menus/Classes/Domain/Repository/MenuRepository.php:165
/var/www/work/typo3-play/packages/menus/Classes/Domain/Repository/MenuRepository.php:59
/var/www/work/typo3-play/packages/menus/Tests/Unit/Domain/Repository/MenuRepositoryTest.php:90
/var/www/work/typo3-play/packages/menus/.Build/vendor/phpunit/phpunit/phpunit:76

--

There were 2 failures:

1) B13\Menus\Tests\Unit\Domain\Repository\MenuRepositoryTest::getSubPagesOfPageRestrictQueryToExcludeDoktypes
Some predictions failed:
Double\TYPO3\CMS\Core\Domain\Repository\PageRepository\P6:
  No calls have been made that match:
      Double\TYPO3\CMS\Core\Domain\Repository\PageRepository\P6->getMenu(exact(1), exact("*"), exact("sorting"), exact("AND doktype NOT IN (6,255,254) AND nav_hide=0 "), exact(false))
    but expected at least one.
    Recorded `getMenu(...)` calls:
      - getMenu(1, "*", "sorting", "AND doktype NOT IN (6,255,254) ", false) @ /var/www/work/typo3-play/packages/menus/Classes/Domain/Repository/MenuRepository.php:146

/var/www/work/typo3-play/packages/menus/.Build/vendor/phpunit/phpunit/phpunit:76

2) B13\Menus\Tests\Unit\Domain\Repository\MenuRepositoryTest::getSubPagesOfPageMergeExcludeDoktypesFromConfiguration
Some predictions failed:
Double\TYPO3\CMS\Core\Domain\Repository\PageRepository\P6:
  No calls have been made that match:
      Double\TYPO3\CMS\Core\Domain\Repository\PageRepository\P6->getMenu(exact(1), exact("*"), exact("sorting"), exact("AND doktype NOT IN (6,255,254,99) AND nav_hide=0 "), exact(false))
    but expected at least one.
    Recorded `getMenu(...)` calls:
      - getMenu(1, "*", "sorting", "AND doktype NOT IN (6,255,254,99) ", false) @ /var/www/work/typo3-play/packages/menus/Classes/Domain/Repository/MenuRepository.php:146

/var/www/work/typo3-play/packages/menus/.Build/vendor/phpunit/phpunit/phpunit:76

ERRORS!
Tests: 6, Assertions: 29, Errors: 1, Failures: 2.
Removing local_unit_run_a24fb92c288c ... done
Removing network local_default

The error could be solved by providing nav_hide values in the rootline data. But what be should be thinked about is, to fix this really.

The two failiures are, that the assumed query is not that one which is really build in the menuRepository.

PullRequests to get unit tests green will come.