Пример #1
0
 public function testModelsCanBeDeleted()
 {
     $example = new Example();
     $repository = $example->getRepository();
     $repository->clearObjectCache();
     $example->save();
     $this->assertCount(1, new Collection("Example"));
     $example->delete();
     $this->assertCount(0, new Collection("Example"));
     // Test that deleting a new model throws an exception.
     $this->setExpectedException("Rhubarb\\Stem\\Exceptions\\DeleteModelException");
     $example = new Example();
     $example->delete();
 }