Commit 6daeb3c7 authored by catch's avatar catch

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

parent 1c177411
......@@ -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 @@ public static function getInfo() {
);
}
function setUp() {
parent::setUp();
}
/**
* Confirms that a route compiles properly with the necessary data.
*/
......@@ -35,9 +34,9 @@ public function testCompilation() {
$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 @@ public function testCompilationDefaultValue() {
$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.');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment