Skip to content

Commit

Permalink
Removing two cases that are covered by type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
burzum committed Aug 20, 2017
1 parent 9a24084 commit 9e8beca
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions tests/TestCase/Database/SchemaCacheTest.php
Expand Up @@ -214,39 +214,4 @@ public function testGetSchemaWithConnectionInstance()
$this->assertInstanceOf(CachedCollection::class, $result);
}

/**
* Test passing invalid object
*
* @expectedException \TypeError
* @return void
*/
public function testPassingInvalidObjectPhp7()
{
$this->skipIf(phpversion() < 7.0);
new SchemaCache(new Entity());
}

/**
* Test passing invalid object
*
* @return void
*/
public function testPassingInvalidObjectPhp56()
{
$this->skipIf(phpversion() > 7.0);

$capture = function ($errno, $msg) {
restore_error_handler();
$this->assertEquals(E_RECOVERABLE_ERROR, $errno);
$this->assertContains('Argument 1 passed to Cake\Database\SchemaCache::getSchema() must implement interface Cake\Datasource\ConnectionInterface, instance of Cake\ORM\Entity given', $msg);
};
set_error_handler($capture);

try {
new SchemaCache(new Entity());
$this->fail('Exception not thrown');
} catch (\RuntimeException $e) {
$this->assertEquals('The given connection object is not compatible with schema caching, as it does not implement a "schemaCollection()" method.', $e->getMessage());
}
}
}

0 comments on commit 9e8beca

Please sign in to comment.