Exemplo n.º 1
0
 public function testConvertToSeconds()
 {
     $this->assertSame(3, \histou\helper\CustomTime::convertToSeconds("3s"));
     $this->assertSame(180, \histou\helper\CustomTime::convertToSeconds("3m"));
     $this->assertSame(10800, \histou\helper\CustomTime::convertToSeconds("3h"));
     $this->assertSame(259200, \histou\helper\CustomTime::convertToSeconds("3d"));
     $this->assertSame(7776000, \histou\helper\CustomTime::convertToSeconds("3M"));
     $this->assertSame(-1, \histou\helper\CustomTime::convertToSeconds("3"));
     $this->assertSame(-2, \histou\helper\CustomTime::convertToSeconds("3Y"));
 }