Exemplo n.º 1
0
 /**
  * Execute the action
  *
  * @access public
  * @param  array   $data   Event data dictionary
  * @return bool            True if the action was executed or false when not executed
  */
 public function execute(array $data)
 {
     if (isset($data['project_id'])) {
         return $this->project->updateModificationDate($data['project_id']);
     }
     return false;
 }
Exemplo n.º 2
0
 public function testUpdateLastModifiedDate()
 {
     $p = new Project($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     $now = time();
     $project = $p->getById(1);
     $this->assertNotEmpty($project);
     $this->assertEquals($now, $project['last_modified'], 'Wrong Timestamp', 1);
     sleep(1);
     $this->assertTrue($p->updateModificationDate(1));
     $project = $p->getById(1);
     $this->assertNotEmpty($project);
     $this->assertGreaterThan($now, $project['last_modified']);
 }
Exemplo n.º 3
0
 public function testUpdateLastModifiedDate()
 {
     $p = new Project($this->registry);
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     $now = time();
     $project = $p->getById(1);
     $this->assertNotEmpty($project);
     $this->assertEquals($now, $project['last_modified']);
     sleep(1);
     $this->assertTrue($p->updateModificationDate(1));
     $project = $p->getById(1);
     $this->assertNotEmpty($project);
     $this->assertEquals($now + 1, $project['last_modified']);
 }