Skip to content

Commit

Permalink
Switch to phpunit 8 to fix deprecation warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
W0rma committed Nov 30, 2019
1 parent f6211df commit d2bf57f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions Tests/DependencyInjection/BazingaHateoasExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

class BazingaHateoasExtensionTest extends TestCase
{
public function setUp()
public function setUp(): void
{
$this->clearTempDir();
}

public function tearDown()
public function tearDown(): void
{
$this->clearTempDir();
}
Expand Down Expand Up @@ -69,11 +69,10 @@ public function testRelationProviderPassInvalidProvider()
$this->assertCount(3, $arguments[0]);
}

/**
* @expectedException InvalidArgumentException
*/
public function testRelationProviderPass()
{
$this->expectException(InvalidArgumentException::class);

$container = $this->getContainerForConfig([[]]);
$definition = $container->register('invalid_relation_provider', 'stdClass');
$definition->addTag('hateoas.relation_provider');
Expand Down Expand Up @@ -125,22 +124,20 @@ public function testLoadSerializer()
$this->assertInstanceOf('Hateoas\Serializer\XmlSerializer', $reflProp->getValue($xmlListener));
}

/**
* @expectedException Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
*/
public function testNotLoadingTwigHelper()
{
$this->expectException(InvalidArgumentException::class);

$container = $this->getContainerForConfig(['bazinga_hateoas' => ['twig_extension' => ['enabled' => false]]]);
$container->findDefinition('hateoas.twig.link');
$container->compile();
}

/**
* @expectedException Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
* @expectedExceptionMessage Service invalid_configuration_extension tagged with hateoas.configuration_extension must implement Hateoas\Configuration\Metadata\ConfigurationExtensionInterface
*/
public function testLoadInvalidConfigurationExtension()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Service invalid_configuration_extension tagged with hateoas.configuration_extension must implement Hateoas\Configuration\Metadata\ConfigurationExtensionInterface');

$container = $this->getContainerForConfig([[]]);
$container
->setDefinition(
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"require-dev": {
"twig/twig": "~1.12|~2.0",
"phpunit/phpunit": "^7",
"phpunit/phpunit": "^8.4",
"symfony/stopwatch": "~3.0 || ~4.0",
"doctrine/coding-standard": "^5.0"
},
Expand Down

0 comments on commit d2bf57f

Please sign in to comment.