for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the AppleApnPush package
*
* (c) Vitaliy Zhuk <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code
*/
namespace Tests\Apple\ApnPush\Model;
use Apple\ApnPush\Model\Expiration;
use PHPUnit\Framework\TestCase;
class ExpirationTest extends TestCase
{
/**
* @test
* @expectedException \LogicException
* @expectedExceptionMessage Can not get value of expiration from null value.
public function shouldThrowExceptionInGetValueIfExpirationIsNull()
$expiration = Expiration::fromNull();
$expiration->getValue();
}
public function shouldReturnZeroIfNotStore()
$expiration = Expiration::notStore();
$value = $expiration->getValue();
self::assertEquals(0, $value);
public function shouldSuccessGetValue()
$now = new \DateTime();
$expiration = Expiration::storeTo($now);
self::assertEquals($now->format('U'), $value);