Example #1
0
 /**
  * Test creating and getting an entity manager
  *
  * @return void
  * @author Dan Cox
  */
 public function test_createEntityManager()
 {
     $conn = new Connection(__DIR__);
     $em = $conn->load($this->config)->create();
     $this->assertInstanceOf('\\Doctrine\\ORM\\EntityManager', $em);
     $this->assertInstanceOf('\\Doctrine\\ORM\\EntityManager', Connection::getEntity());
 }
Example #2
0
 /**
  * Create a connection and inject to database class
  *
  * @return void
  * @author Dan Cox
  */
 public function test_entity()
 {
     $this->database->setEntity(Connection::getEntity());
     $this->database->setModel('Users');
     $this->assertInstanceOf('\\Doctrine\\ORM\\EntityManager', $this->database->getEntity());
     $this->assertEquals('Users', $this->database->getModel());
 }
Example #3
0
 /**
  * Grab the default entity from the Connection class
  *
  * @return void
  * @author Dan Cox
  */
 public function __construct()
 {
     $this->entity = Connection::getEntity();
 }