Add logger to Game, along with some basic log messages
This commit is contained in:
@@ -13,26 +13,27 @@ class BootstrapTest extends \PHPUnit_Framework_TestCase
|
||||
$g = Bootstrap::createGame();
|
||||
$this->assertNotNull($g->getEntityManager());
|
||||
$this->assertNotNull($g->getEventManager());
|
||||
$this->assertNotNull($g->getLogger());
|
||||
}
|
||||
|
||||
|
||||
public function testDoctrineReadsAnnotationsFromAdditionalMetaDataDirectory()
|
||||
{
|
||||
Bootstrap::registerAnnotationMetaDataDirectory(__DIR__ . "/AdditionalEntities");
|
||||
|
||||
|
||||
$g = Bootstrap::createGame();
|
||||
|
||||
|
||||
$user = new UserEntity();
|
||||
$user->setName("Monthy");
|
||||
|
||||
|
||||
$g->getEntityManager()->persist($user);
|
||||
$g->getEntityManager()->flush();
|
||||
|
||||
|
||||
$id = $user->getId();
|
||||
$this->assertInternalType("int", $id);
|
||||
|
||||
|
||||
$g->getEntityManager()->clear();
|
||||
$user = $g->getEntityManager()->getRepository(UserEntity::class)->find($id);
|
||||
|
||||
|
||||
$this->assertInternalType("int", $user->getId());
|
||||
$this->assertInternalType("string", $user->getName());
|
||||
$this->assertSame("Monthy", $user->getName());
|
||||
|
||||
Reference in New Issue
Block a user