public function testConnection() { $source = new MockSource(array('autoConnect' => false)); $this->assertFalse($source->isConnected()); $this->assertTrue($source->isConnected(array('autoConnect' => true))); $this->assertTrue($source->isConnected()); }
public function testItem() { $source = new MockSource(); $entity = $source->item('Foo', array('foo' => 'bar')); $this->assertTrue($entity instanceof Entity); $this->assertEqual('Foo', $entity->model()); $this->assertEqual(array('foo' => 'bar'), $entity->data()); }
public function testItem() { $source = new MockSource(); $entity = $source->item('lithium\\tests\\mocks\\data\\MockPost', array('foo' => 'bar')); $this->assertInstanceOf('lithium\\data\\Entity', $entity); $this->assertEqual('lithium\\tests\\mocks\\data\\MockPost', $entity->model()); $this->assertEqual(array('foo' => 'bar'), $entity->data()); }