Browse Source

Fix tests.

mscherer 7 years ago
parent
commit
be83bbfeb7
2 changed files with 10 additions and 9 deletions
  1. 2 2
      tests/TestCase/ORM/BehaviorTest.php
  2. 8 7
      tests/TestCase/Routing/Route/RouteTest.php

+ 2 - 2
tests/TestCase/ORM/BehaviorTest.php

@@ -267,7 +267,7 @@ class BehaviorTest extends TestCase
     public function testVerifyImplementedFindersInvalid()
     {
         $this->expectException(\Cake\Core\Exception\Exception::class);
-        $this->expectExceptionMessage('The method findNotDefined is not callable on class Cake\Test\TestCase\ORM\Test2Behavior');
+        $this->expectExceptionMessage('The method findNotDefined is not callable on class ' . Test2Behavior::class);
         $table = $this->getMockBuilder(Table::class)->getMock();
         $behavior = new Test2Behavior($table, [
             'implementedFinders' => [
@@ -306,7 +306,7 @@ class BehaviorTest extends TestCase
     public function testVerifyImplementedMethodsInvalid()
     {
         $this->expectException(Exception::class);
-        $this->expectExceptionMessage('The method iDoNotExist is not callable on class Cake\Test\TestCase\ORM\Test2Behavior');
+        $this->expectExceptionMessage('The method iDoNotExist is not callable on class ' . Test2Behavior::class);
         $table = $this->getMockBuilder(Table::class)->getMock();
         $behavior = new Test2Behavior($table, [
             'implementedMethods' => [

+ 8 - 7
tests/TestCase/Routing/Route/RouteTest.php

@@ -20,6 +20,7 @@ use Cake\Http\ServerRequest;
 use Cake\Routing\Route\Route;
 use Cake\Routing\Router;
 use Cake\TestSuite\TestCase;
+use TestApp\Routing\Route\ProtectedRoute;
 
 /**
  * Test case for Route
@@ -307,7 +308,7 @@ class RouteTest extends TestCase
      */
     public function testMatchParseExtension($url, array $expected, array $ext)
     {
-        $route = new RouteProtected('/:controller/:action/*', [], ['_ext' => $ext]);
+        $route = new ProtectedRoute('/:controller/:action/*', [], ['_ext' => $ext]);
         $result = $route->parseExtension($url);
         $this->assertEquals($expected, $result);
     }
@@ -337,7 +338,7 @@ class RouteTest extends TestCase
      */
     public function testNoMatchParseExtension($url, array $ext)
     {
-        $route = new RouteProtected('/:controller/:action/*', [], ['_ext' => $ext]);
+        $route = new ProtectedRoute('/:controller/:action/*', [], ['_ext' => $ext]);
         list($outUrl, $outExt) = $route->parseExtension($url);
         $this->assertEquals($url, $outUrl);
         $this->assertNull($outExt);
@@ -350,7 +351,7 @@ class RouteTest extends TestCase
      */
     public function testSetExtensions()
     {
-        $route = new RouteProtected('/:controller/:action/*', []);
+        $route = new ProtectedRoute('/:controller/:action/*', []);
         $this->assertEquals([], $route->getExtensions());
         $route->setExtensions(['xml']);
         $this->assertEquals(['xml'], $route->getExtensions());
@@ -359,7 +360,7 @@ class RouteTest extends TestCase
         $route->setExtensions([]);
         $this->assertEquals([], $route->getExtensions());
 
-        $route = new RouteProtected('/:controller/:action/*', [], ['_ext' => ['one', 'two']]);
+        $route = new ProtectedRoute('/:controller/:action/*', [], ['_ext' => ['one', 'two']]);
         $this->assertEquals(['one', 'two'], $route->getExtensions());
     }
 
@@ -370,13 +371,13 @@ class RouteTest extends TestCase
      */
     public function testGetExtensions()
     {
-        $route = new RouteProtected('/:controller/:action/*', []);
+        $route = new ProtectedRoute('/:controller/:action/*', []);
         $this->assertEquals([], $route->getExtensions());
 
-        $route = new RouteProtected('/:controller/:action/*', [], ['_ext' => ['one', 'two']]);
+        $route = new ProtectedRoute('/:controller/:action/*', [], ['_ext' => ['one', 'two']]);
         $this->assertEquals(['one', 'two'], $route->getExtensions());
 
-        $route = new RouteProtected('/:controller/:action/*', []);
+        $route = new ProtectedRoute('/:controller/:action/*', []);
         $this->assertEquals([], $route->getExtensions());
         $route->setExtensions(['xml', 'json', 'zip']);
         $this->assertEquals(['xml', 'json', 'zip'], $route->getExtensions());