/**
  * @covers \odTimeTracker\Model\ActivityMapper::update
  */
 public function testUpdate()
 {
     $mapper = new \odTimeTracker\Model\ActivityMapper(self::$pdo);
     $activities = self::getDataActivities();
     $activity1 = new \odTimeTracker\Model\ActivityEntity($activities[0]);
     $activity1->setName('(Updated) ' . $activity1->getName());
     $activity1->setDescription('(Updated) ' . $activity1->getDescription());
     $res1 = $mapper->update($activity1);
     $this->assertInstanceOf('\\odTimeTracker\\Model\\ActivityEntity', $res1);
     $this->assertEquals('(Updated) ' . $activities[0]['Name'], $res1->getName());
     $this->assertEquals('(Updated) ' . $activities[0]['Description'], $res1->getDescription());
     $activity2 = new \odTimeTracker\Model\ActivityEntity();
     $activity2->setName('Test activity');
     $res2 = $mapper->update($activity2);
     $this->assertFalse($res2);
 }
 /**
  * @covers \odTimeTracker\Model\ActivityEntity::isRunning
  */
 public function testIsRunning()
 {
     $activity1 = new \odTimeTracker\Model\ActivityEntity(array('Name' => 'Test activity', 'Started' => '2015-06-02 10:00:00+01:00', 'Stopped' => '2015-06-03 11:01:01+01:00'));
     $this->assertFalse($activity1->isRunning());
     $activity2 = new \odTimeTracker\Model\ActivityEntity(array('Name' => 'Test activity', 'Started' => '2015-06-03 10:00:00+01:00', 'Stopped' => null));
     $this->assertTrue($activity2->isRunning());
 }