Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge 5fc90d8 into 2991318
Browse files Browse the repository at this point in the history
  • Loading branch information
foaly-nr1 committed Nov 14, 2017
2 parents 2991318 + 5fc90d8 commit d65ae9f
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 203 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"kleijnweb/php-api-hydrator": "^v1.0.0-alpha2"
},
"require-dev": {
"phpunit/phpunit": "^5.2",
"phpunit/phpunit-mock-objects": "^3.1",
"phpunit/phpunit": "^6.4",
"symfony/framework-bundle": ">=2.8.7",
"symfony/security-bundle": ">=2.8.7",
"symfony/monolog-bridge": ">=2.8.7",
Expand Down
17 changes: 6 additions & 11 deletions tests/unit/BundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,19 @@

use KleijnWeb\PhpApi\RoutingBundle\DependencyInjection\PhpApiRoutingExtension;
use KleijnWeb\PhpApi\RoutingBundle\PhpApiRoutingBundle;
use PHPUnit\Framework\TestCase;

class BundleTest extends \PHPUnit_Framework_TestCase
class BundleTest extends TestCase
{
/**
* @test
*/
public function canGetExtension()
public function testCanGetExtension()
{
$routingBundle = new PhpApiRoutingBundle();
$this->assertInstanceOf(PhpApiRoutingExtension::class, $routingBundle->getContainerExtension());
self::assertInstanceOf(PhpApiRoutingExtension::class, $routingBundle->getContainerExtension());
}

/**
* @test
*/
public function canGetNamespace()
public function testCanGetNamespace()
{
$routingBundle = new PhpApiRoutingBundle();
$this->assertSame('KleijnWeb\PhpApi\RoutingBundle', $routingBundle->getNamespace());
self::assertSame('KleijnWeb\PhpApi\RoutingBundle', $routingBundle->getNamespace());
}
}
13 changes: 5 additions & 8 deletions tests/unit/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@

namespace FOS\HttpCacheBundle\Tests\Unit\DependencyInjection;


use KleijnWeb\PhpApi\RoutingBundle\DependencyInjection\Configuration;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class ConfigurationTest extends \PHPUnit_Framework_TestCase
class ConfigurationTest extends TestCase
{
/**
* @test
*/
public function willReturnTreeBuilder()
public function testWillReturnTreeBuilder()
{
$extension = new Configuration();
$this->assertInstanceOf(TreeBuilder::class, $extension->getConfigTreeBuilder());
self::assertInstanceOf(TreeBuilder::class, $extension->getConfigTreeBuilder());
}
}
}
21 changes: 8 additions & 13 deletions tests/unit/DependencyInjection/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
namespace KleijnWeb\PhpApi\RoutingBundle\Tests\DependencyInjection;

use KleijnWeb\PhpApi\RoutingBundle\DependencyInjection\PhpApiRoutingExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ExtensionTest extends \PHPUnit_Framework_TestCase
class ExtensionTest extends TestCase
{
/**
* @var PhpApiRoutingExtension
Expand All @@ -23,23 +24,17 @@ protected function setUp()
$this->extension = new PhpApiRoutingExtension();
}

/**
* @test
*/
public function hasRouteLoaderTag()
public function testHasRouteLoaderTag()
{
$container = new ContainerBuilder();
$this->extension->load([], $container);
$this->assertTrue($container->hasDefinition('openapi.route_loader'));
self::assertTrue($container->hasDefinition('openapi.route_loader'));
$routeLoader = $container->getDefinition('openapi.route_loader');
$this->assertSame([[]], $routeLoader->getTag('routing.loader'));
self::assertSame([[]], $routeLoader->getTag('routing.loader'));
}

/**
* @test
*/
public function hasAlias()
public function testHasAlias()
{
$this->assertSame('api_routing', $this->extension->getAlias());
self::assertSame('api_routing', $this->extension->getAlias());
}
}
}

0 comments on commit d65ae9f

Please sign in to comment.