diff --git a/tests/TestCase/TestSuite/TestCaseTest.php b/tests/TestCase/TestSuite/TestCaseTest.php index 2a87e53e333..73ad2d4ddc7 100644 --- a/tests/TestCase/TestSuite/TestCaseTest.php +++ b/tests/TestCase/TestSuite/TestCaseTest.php @@ -494,16 +494,26 @@ public function testGetMockForModelTable() $entity = new Entity([]); $this->assertTrue($Mock->save($entity)); $this->assertFalse($Mock->save($entity)); - - $Mock = $this->getMockForModel( + + $allMethodsStubs = $this->getMockForModel( 'Table', - null, + [], ['alias' => 'Comments', 'className' => '\Cake\ORM\Table'] ); + $result = $this->getTableLocator()->get('Comments'); + $this->assertInstanceOf('Cake\ORM\Table', $result); + $this->assertEmpty([], $allMethodsStubs->getAlias()); + $allMethodsMocks = $this->getMockForModel( + 'Table', + null, + ['alias' => 'Comments', 'className' => '\Cake\ORM\Table'] + ); $result = $this->getTableLocator()->get('Comments'); $this->assertInstanceOf('Cake\ORM\Table', $result); - $this->assertEquals('Comments', $Mock->getAlias()); + $this->assertEquals('Comments', $allMethodsMocks->getAlias()); + + $this->assertNotEquals($allMethodsStubs, $allMethodsMocks); } /**