コード例 #1
0
ファイル: ConnectionTest.php プロジェクト: baszoetekouw/janus
 public function testUpdatingCreatesRevision()
 {
     $connection = new Connection('a', 'saml20-idp');
     $configMock = new ConfigProxy(array(), 'a');
     $connection->update(new MetadataDefinitionHelper($configMock), 'a', 'saml20-idp', null, 'testNote', 'test', new \DateTime(), 'testurl', true, array(), null, true);
     $this->assertInstanceOf('Janus\\ServiceRegistry\\Entity\\Connection\\Revision', $connection->getLatestRevision());
 }
コード例 #2
0
ファイル: Revision.php プロジェクト: baszoetekouw/janus
 /**
  * @param $dto
  */
 private function toDtoAuditProperties($dto)
 {
     if (empty($this->id)) {
         return;
     }
     $dto->createdAtDate = $this->connection->getCreatedAtDate();
     $dto->updatedAtDate = $this->createdAtDate;
     $dto->updatedFromIp = (string) $this->updatedFromIp;
     $dto->updatedByUserName = $this->updatedByUser instanceof User ? $this->updatedByUser->getUsername() : '';
 }
コード例 #3
0
ファイル: testDoctrine.php プロジェクト: baszoetekouw/janus
$em->flush();
$em->remove($userMessage);
$em->flush();
$userSubscription = new User\Subscription($subscribingUser, 'testSubscription', 'testType');
$em->persist($userSubscription);
$em->flush();
$em->remove($userSubscription);
$em->flush();
$em->remove($subscribingUser);
$em->flush();
$connection = new Connection('test-idp' . time(), 'saml20-idp');
$connection->update($connection->getName(), $connection->getType(), null, 'initial', 'testaccepted', new \DateTime(), 'http://test', true, array('foo'), null, true, null);
$connectionRevision = $connection->getLatestRevision();
$em->persist($connection);
$em->flush();
$remoteConnection = new Connection('test-sp' . time(), 'saml20-sp');
$remoteConnection->update($remoteConnection->getName(), $remoteConnection->getType(), null, 'initial', 'test', new \DateTime(), 'http://test', true, null, null, true, null);
$remoteConnectionRevision = $remoteConnection->getLatestRevision();
$em->persist($remoteConnection);
$em->flush();
$connectionAllowedConnectionRelation = new Connection\Revision\AllowedConnectionRelation($connectionRevision, $remoteConnection);
$em->persist($connectionAllowedConnectionRelation);
$em->flush();
$em->remove($connectionAllowedConnectionRelation);
$em->flush();
$connectionBlockedConnectionRelation = new Connection\Revision\BlockedConnectionRelation($connectionRevision, $remoteConnection);
$em->persist($connectionBlockedConnectionRelation);
$em->flush();
$em->remove($connectionBlockedConnectionRelation);
$em->flush();
$connectionDisableConsentRelation = new Connection\Revision\DisableConsentRelation($connectionRevision, $remoteConnection);