public function testMethodDispatchWithNoModel() { $data = array('foo' => true); $entity = new Entity(compact('data')); $this->expectException("/^No model bound to call `foo`.\$/"); $entity->foo(); }
public function testMethodDispatch() { $entity = new Entity(array('model' => $this->_model, 'data' => array('foo' => true))); $this->assertTrue($entity->validates()); $this->expectException("/^No model bound or unhandled method call `foo`.\$/"); $entity->foo(); }
public function testMethodDispatchWithEntityAsModel() { $data = array('foo' => true); $model = 'lithium\\data\\Entity'; $entity = new Entity(compact('model', 'data')); $this->assertException("/^No model bound to call `foo`.\$/", function () use($entity) { $entity->foo(); }); }