Inheritance: extends lithium\data\Source
Ejemplo n.º 1
0
 public function testConnection()
 {
     $source = new MockSource(array('autoConnect' => false));
     $this->assertFalse($source->isConnected());
     $this->assertTrue($source->isConnected(array('autoConnect' => true)));
     $this->assertTrue($source->isConnected());
 }
Ejemplo n.º 2
0
 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());
 }
Ejemplo n.º 3
0
 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());
 }