Example #1
0
 /**
  * @test
  * @group library
  */
 public function checkUpdateDateOnReturnObject()
 {
     $groupId = 'GROUP-863dd940-6595-4b30-b7b2-9307b623e8cd-GROUP';
     $pageRights = array('allrights' => true);
     $testGroup = $this->service->setPageRights($groupId, $this->websiteId, $pageRights);
     $this->assertNotNull($testGroup->getLastupdate());
     $maxAlter = date('Y-m-d H:i:s', time() - 2);
     $this->assertGreaterThan($maxAlter, $testGroup->getLastupdate());
 }
Example #2
0
 /**
  * @test
  * @group library
  */
 public function createGroupAsExpected()
 {
     $createValues = array('name' => 'service_test_group_0');
     $testGroup = $this->service->create($this->websiteId, $createValues);
     $this->assertInstanceOf('Cms\\Data\\Group', $testGroup);
     $this->assertSame($createValues['name'], $testGroup->getName());
     $this->assertSame($this->websiteId, $testGroup->getWebsiteId());
     $this->assertTrue($this->validateUniqueId(new DataGroup(), $testGroup->getId()));
     // Timestamp der letzten Aenderung darf nicht aelter sein als ein paar Sekunden
     $this->assertNotNull($testGroup->getLastupdate());
     $currentTime = time();
     $this->assertLessThanOrEqual($currentTime, $testGroup->getLastupdate());
     $this->assertGreaterThan($currentTime - 2, $testGroup->getLastupdate());
 }
Example #3
0
 /**
  * @test
  * @group library
  */
 public function checkUpdateDateOnReturnObject()
 {
     $groupId = 'GROUP-2d1fca5b-1bc5-4558-b684-4cd3322eb923-GROUP';
     $editValues = array('name' => 'test edit last update');
     $testGroup = $this->service->edit($groupId, $this->websiteId, $editValues);
     $this->assertInstanceOf('Cms\\Data\\Group', $testGroup);
     $this->assertSame($editValues['name'], $testGroup->getName());
     $this->assertSame($this->websiteId, $testGroup->getWebsiteId());
     $this->assertSame($groupId, $testGroup->getId());
     // Timestamp der letzten Aenderung darf nicht aelter sein als ein paar Sekunden
     $this->assertNotNull($testGroup->getLastupdate());
     $maxAlter = date('Y-m-d H:i:s', time() - 2);
     $this->assertGreaterThan($maxAlter, $testGroup->getLastupdate());
 }