public function testconfiguration()
 {
     $config = new Configuration();
     $config->setCurrentUser($this->ZfcUserMock);
     $prefix = "prefix";
     $config->setTablePrefix($prefix);
     $suffix = "suffix";
     $config->setTableSuffix($suffix);
     $fieldName = "fieldName";
     $config->setRevisionFieldName($fieldName);
     $revisionIdFieldType = "string";
     $config->setRevisionIdFieldType($revisionIdFieldType);
     $tableName = "tableName";
     $config->setRevisionTableName($tableName);
     $revisionTypeFieldName = "string";
     $config->setRevisionTypeFieldName($revisionTypeFieldName);
     $ipaddress = $config->getIpAddress();
     $config->setAuditedEntityClasses(array('ZF2EntityAuditTest\\Entity\\Article', 'ZF2EntityAuditTest\\Entity\\Writer'));
     $config->setNote("default note");
     $this->auditManager = new Manager($config);
     $this->auditManager->registerEvents($this->em->getEventManager());
     /// creating the tables
     $this->schemaTool = $this->getSchemaTool();
     $this->schemaTool->createSchema(array($this->em->getClassMetadata('ZF2EntityAuditTest\\Entity\\Article'), $this->em->getClassMetadata('ZF2EntityAuditTest\\Entity\\Writer')));
     $this->assertInstanceOf("ZfcUser\\Entity\\User", $this->ZfcUserMock);
     $this->assertEquals($prefix, $config->getTablePrefix());
     $this->assertEquals($suffix, $config->getTableSuffix());
     $this->assertEquals($fieldName, $config->getRevisionFieldName());
     $this->assertEquals($tableName, $config->getRevisionTableName());
     $this->assertEquals($revisionIdFieldType, $config->getRevisionIdFieldType());
     $this->assertEquals($revisionTypeFieldName, $config->getRevisionIdFieldType());
     $this->assertEquals($ipaddress, "1.1.1.9");
 }
Beispiel #2
0
 public function setUp()
 {
     $this->Bootstrap = new Bootstrap();
     $this->em = $this->Bootstrap->getServiceManager()->get("doctrine.entitymanager.orm_default");
     /// echo sql logger
     //$this->em->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());;
     /// let's create the default user
     $this->ZfcUserMock = $this->createUser();
     $auditConfig = new Configuration();
     $auditConfig->setCurrentUser($this->ZfcUserMock);
     $auditConfig->setAuditedEntityClasses(array('ZF2EntityAuditTest\\Entity\\Article', 'ZF2EntityAuditTest\\Entity\\Writer'));
     $auditConfig->setNote("default note");
     $this->auditManager = new Manager($auditConfig);
     $this->auditManager->registerEvents($this->em->getEventManager());
     /// creating the tables
     $this->schemaTool = $this->getSchemaTool();
     $this->schemaTool->createSchema(array($this->em->getClassMetadata('ZF2EntityAuditTest\\Entity\\Article'), $this->em->getClassMetadata('ZF2EntityAuditTest\\Entity\\Writer')));
 }