Skip to content
Permalink
Browse files

Altering the all tests suite so it runs all database tests with the

permutations decorator, fixing some tests that were poluting th
eenvironment and breaking the run when repeated
  • Loading branch information...
lorenzo committed Nov 6, 2013
1 parent 7b9ba5a commit 9734bdefc89f5be61721b7cb87c7b6a5db3ee9e6
Showing with 17 additions and 3 deletions.
  1. +4 −1 Cake/Test/TestCase/ORM/TableRegistryTest.php
  2. +10 −2 Cake/Test/TestCase/ORM/TableTest.php
  3. +3 −0 phpunit.xml.dist
@@ -136,7 +136,10 @@ public function testBuildConvention() {
->method('defaultConnectionName')
->will($this->returnValue('test'));
class_alias($class, 'MyPlugin\Model\Repository\SuperTestTable');
if (!class_exists('MyPlugin\Model\Repository\SuperTestTable')) {
class_alias($class, 'MyPlugin\Model\Repository\SuperTestTable');
}
$table = TableRegistry::get('MyPlugin.SuperTest');
$this->assertInstanceOf($class, $table);
}
@@ -793,7 +793,11 @@ public function testEntityClassDefault() {
*/
public function testRepositoryClassInAPP() {
$class = $this->getMockClass('\Cake\ORM\Entity');
class_alias($class, 'TestApp\Model\Entity\TestUser');
if (!class_exists('TestApp\Model\Entity\TestUser')) {
class_alias($class, 'TestApp\Model\Entity\TestUser');
}
$table = new Table();
$this->assertEquals('TestApp\Model\Entity\TestUser', $table->entityClass('TestUser'));
}
@@ -806,7 +810,11 @@ class_alias($class, 'TestApp\Model\Entity\TestUser');
*/
public function testRepositoryClassInPlugin() {
$class = $this->getMockClass('\Cake\ORM\Entity');
class_alias($class, 'MyPlugin\Model\Entity\SuperUser');
if (!class_exists('MyPlugin\Model\Entity\SuperUser')) {
class_alias($class, 'MyPlugin\Model\Entity\SuperUser');
}
$table = new Table();
$this->assertEquals(
'MyPlugin\Model\Entity\SuperUser',
@@ -15,7 +15,10 @@
<testsuites>
<testsuite name="CakePHP Test Suite">
<directory>./Cake/Test/TestCase/</directory>
<exclude>./Cake/Test/TestCase/Database/</exclude>
<exclude>./Cake/Test/TestCase/Model/</exclude>
<exclude>./Cake/Test/TestCase/ORM/</exclude>
<file>./Cake/Test/TestCase/DatabaseSuite.php</file>
</testsuite>
</testsuites>
<listeners>

0 comments on commit 9734bde

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