Skip to content
Permalink
Browse files

added some tests

  • Loading branch information...
mirko-pagliai committed Nov 12, 2018
1 parent fca3d9f commit 0716dd28fb0d09dfb0434a743b9ba54d742eb01b
Showing with 14 additions and 4 deletions.
  1. +14 −4 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);
}
/**

0 comments on commit 0716dd2

Please sign in to comment.
You can’t perform that action at this time.