Commit 52fd2752 authored by Crell's avatar Crell Committed by effulgentsia
Browse files

Convert tests to namespaced format.

parent 3019c6f7
<?php
/**
* @file
* Definition of Drupal\system\Tests\Routing\RouteTest.
*/
namespace Drupal\system\Tests\Routing;
use Symfony\Component\Routing\Route;
use Drupal\simpletest\UnitTestBase;
use Drupal\Core\Database\Database;
/**
* Basic tests for the Route.
*/
class RouteTest extends UnitTestBase {
public static function getInfo() {
return array(
'name' => 'Routes',
'description' => 'Confirm that route object is functioning properly.',
'group' => 'Routing',
);
}
function setUp() {
parent::setUp();
}
public function testCompilation() {
$route = new Route('/test/{something}/more');
$route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
$compiled = $route->compile();
$this->assertEqual($route, $compiled->getRoute(), t('Compiled route has the correct route object.'));
$this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, t('The fit was correct.'));
$this->assertEqual($compiled->getPatternOutline(), '/test/%/more', t('The pattern outline was correct.'));
}
}
......@@ -2,9 +2,11 @@
/**
* @file
* Tests for Symfony2-related functionality.
* Definition of Drupal\system\Tests\Routing\UrlMatcherDumperTest.
*/
namespace Drupal\system\Tests\Routing;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
......@@ -15,12 +17,12 @@
/**
* Basic tests for the UrlMatcherDumper.
*/
class UrlMatcherDumperTestCase extends UnitTestBase {
class UrlMatcherDumperTest extends UnitTestBase {
public static function getInfo() {
return array(
'name' => 'Routing',
'name' => 'Dumper tests',
'description' => 'Confirm that the matcher dumper is functioning properly.',
'group' => 'Routng',
'group' => 'Routing',
);
}
......@@ -207,32 +209,3 @@ protected function prepareTables($connection) {
}
}
/**
* Basic tests for the Route.
*/
class RouteTestCase extends UnitTestBase {
public static function getInfo() {
return array(
'name' => 'Routes',
'description' => 'Confirm that route object is functioning properly.',
'group' => 'Routng',
);
}
function setUp() {
parent::setUp();
}
public function testCompilation() {
$route = new Route('/test/{something}/more');
$route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
$compiled = $route->compile();
$this->assertEqual($route, $compiled->getRoute(), t('Compiled route has the correct route object.'));
$this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, t('The fit was correct.'));
$this->assertEqual($compiled->getPatternOutline(), '/test/%/more', t('The pattern outline was 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