Issue #2042745 by jhedstrom: Convert system module's RouteTest to phpunit.
parent
1c1774112c
commit
6daeb3c7f2
|
@ -2,19 +2,22 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\system\Tests\Routing\RouteTest.
|
||||
* Contains Drupal\Tests\Core\Routing\RouteCompilerTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\system\Tests\Routing;
|
||||
namespace Drupal\Tests\Core\Routing;
|
||||
|
||||
use Symfony\Component\Routing\Route;
|
||||
|
||||
use Drupal\simpletest\UnitTestBase;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
|
||||
/**
|
||||
* Basic tests for the Route.
|
||||
*
|
||||
* @see \Drupal\Core\Routing\RouteCompiler
|
||||
*/
|
||||
class RouteTest extends UnitTestBase {
|
||||
class RouteCompilerTest extends UnitTestCase {
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Routes',
|
||||
|
@ -23,10 +26,6 @@ class RouteTest extends UnitTestBase {
|
|||
);
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirms that a route compiles properly with the necessary data.
|
||||
*/
|
||||
|
@ -35,9 +34,9 @@ class RouteTest extends UnitTestBase {
|
|||
$route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
|
||||
$compiled = $route->compile();
|
||||
|
||||
$this->assertEqual($route, $compiled->getRoute(), 'Compiled route has the correct route object.');
|
||||
$this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was correct.');
|
||||
$this->assertEqual($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was correct.');
|
||||
$this->assertEquals($route, $compiled->getRoute(), 'Compiled route has the incorrect route object.');
|
||||
$this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was incorrect.');
|
||||
$this->assertEquals($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was not correct.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,9 +51,9 @@ class RouteTest extends UnitTestBase {
|
|||
$route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
|
||||
$compiled = $route->compile();
|
||||
|
||||
$this->assertEqual($route, $compiled->getRoute(), 'Compiled route has the correct route object.');
|
||||
$this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was correct.');
|
||||
$this->assertEqual($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was correct.');
|
||||
$this->assertEquals($route, $compiled->getRoute(), 'Compiled route has an incorrect route object.');
|
||||
$this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was not correct.');
|
||||
$this->assertEquals($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was not correct.');
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue