Open NoNoNo opened 4 years ago
@NoNoNo Could you create a PR for this? If you need any help please let me know.
@florianeckerstorfer Sorry, I don’t know how to fix the unit tests:
There were 2 errors:
1)
Cocur\Slugify\Tests\Bridge\Nette\SlugifyExtensionTest::testLoadConfiguration
`Mockery\Exception`: The class `\Nette\DI\ServiceDefinition` is marked final and its methods cannot be replaced. Classes marked final can be passed in to `\Mockery::mock()` as instantiated objects to create a partial mock, but only if the mock is not subject to type hinting checks. [`slugify/tests/Bridge/Nette/SlugifyExtensionTest.php:31`](https://github.com/cocur/slugify/blob/master/tests/Bridge/Nette/SlugifyExtensionTest.php#L31)
2)
Cocur\Slugify\Tests\Bridge\Nette\SlugifyExtensionTest::testBeforeCompile
`Mockery\Exception`: The class `\Nette\DI\ServiceDefinition` is marked final and its methods cannot be replaced. Classes marked final can be passed in to `\Mockery::mock()` as instantiated objects to create a partial mock, but only if the mock is not subject to type hinting checks. [`slugify/tests/Bridge/Nette/SlugifyExtensionTest.php:82`](https://github.com/cocur/slugify/blob/master/tests/Bridge/Nette/SlugifyExtensionTest.php#L82)
(same problem as PR #231)
Yeah, I got the same errors as @NoNoNo when I was attempting to fix the unit test in my PR. I thought that there's only something wrong with me, as I write tests in Nette Tester and I don't use Mockery.
I get a TypeError with Nette 3:
I managed to fix this with: