Issue #2042745 by jhedstrom: Convert system module's RouteTest to phpunit.

8.0.x
Nathaniel Catchpole 2013-08-01 14:36:08 +01:00
parent 1c1774112c
commit 6daeb3c7f2
1 changed files with 13 additions and 14 deletions

View File

@ -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.');
}
}