implement Cell:isDate() for unification
This commit is contained in:
parent
4c7adbb33f
commit
8901b23d58
@ -182,6 +182,14 @@ class Cell
|
|||||||
return $this->type === self::TYPE_STRING;
|
return $this->type === self::TYPE_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isDate()
|
||||||
|
{
|
||||||
|
return $this->type === self::TYPE_DATE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
@ -54,6 +54,15 @@ class CellTest extends \PHPUnit\Framework\TestCase
|
|||||||
$this->assertTrue((new Cell(false))->isBoolean());
|
$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
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user