/** @test */ public function tableExistsThrowsExceptionIfTableDoesNotExist() { $dbObjMock = $this->getMock('t3lib_DB', array('admin_get_tables'), array(), '', false); $dbObjMock->expects($this->any())->method('admin_get_tables')->will($this->returnValue(array())); $this->saveDbObjInAssertClass(); Tx_PtExtbase_Assertions_Assert::$dbObj = $dbObjMock; try { Tx_PtExtbase_Assertions_Assert::tableExists('pages'); } catch (Exception $e) { $this->restoreDbObjInAssertClass(); // Test is passed, since we get an Exception return; } $this->restoreDbObjInAssertClass(); // Test fails since we did not get an exception $this->fail('Expected exception for asserting that a non-existing table exists was not thrown!'); }