implement Cell:isDate() for unification
This commit is contained in:
parent
e135b71473
commit
21e0e9e6b1
@ -182,6 +182,14 @@ class Cell
|
||||
return $this->type === self::TYPE_STRING;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isDate()
|
||||
{
|
||||
return $this->type === self::TYPE_DATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -54,6 +54,15 @@ class CellTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertTrue((new Cell(false))->isBoolean());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testCellTypeDate()
|
||||
{
|
||||
$this->assertTrue((new Cell(new \DateTime()))->isDate());
|
||||
$this->assertTrue((new Cell(new \DateInterval('P2Y4DT6H8M')))->isDate());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user