Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $this->dt = TimeHelper::now();
         $this->extension = strtolower($this->extension);
         return true;
     }
     return false;
 }
Esempio n. 2
0
 public function testToSeconds()
 {
     $this->assertNull(TimeHelper::toSeconds(null));
     $this->assertNull(TimeHelper::toSeconds('dsasd'));
     $this->assertEquals(0, TimeHelper::toSeconds('00:00:00.000'));
     $this->assertEquals(2, TimeHelper::toSeconds('00:00:01.800'));
     $this->assertEquals(1, TimeHelper::toSeconds('00:00:01.12'));
     $this->assertEquals(422, TimeHelper::toSeconds('00:07:02'));
     $this->assertEquals(422, TimeHelper::toSeconds('00:07:02.360'));
     $this->assertEquals(423, TimeHelper::toSeconds('00:07:02.800'));
     $this->assertEquals(8593, TimeHelper::toSeconds('02:23:13.400'));
 }