Convert tests to namespaced format.

8.0.x
Larry Garfield 2012-06-10 17:32:07 -05:00 committed by effulgentsia
parent 3019c6f74d
commit 52fd27522b
2 changed files with 47 additions and 33 deletions

View File

@ -0,0 +1,41 @@
<?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.'));
}
}

View File

@ -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 @@ use Drupal\Core\Routing\UrlMatcherDumper;
/**
* 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 @@ class UrlMatcherDumperTestCase extends UnitTestBase {
}
}
/**
* 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.'));
}
}