/** * @covers Fuel\Core\OrientDB::delete */ public function testDelete() { try { $result = OrientDB::delete(); $this->fail("Expected exception has not occured."); } catch (NotSupportException $e) { // It's expected exception. Do nothing. } catch (Exception $e) { $name = get_class($e); $this->fail("Unexpected exception {$name}: {$e->getMessage()}"); } try { $result = OrientDB::delete(123); $this->fail("Expected exception has not occured."); } catch (NotSupportException $e) { // It's expected exception. Do nothing. } catch (Exception $e) { $name = get_class($e); $this->fail("Unexpected exception {$name}: {$e->getMessage()}"); } $result = OrientDB::delete("table1"); $this->assertEquals(get_class($result), "Doctrine\\OrientDB\\Query\\Command\\Delete"); $this->assertEquals($result->getTokenValue("Class"), array("table1")); $result = OrientDB::delete(new NotSupportException()); $this->assertEquals(get_class($result), "Doctrine\\OrientDB\\Query\\Command\\Delete"); $this->assertEquals($result->getTokenValue("Class"), array("NotSupportException")); }