File: FixedDateFunctionTest.php

package info (click to toggle)
php-mock 2.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 332 kB
  • sloc: php: 1,703; makefile: 18; xml: 17; sh: 7
file content (26 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace phpmock\functions;

use PHPUnit\Framework\TestCase;

/**
 * Tests FixedDateFunction.
 *
 * @author Markus Malkusch <markus@malkusch.de>
 * @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations
 * @license http://www.wtfpl.net/txt/copying/ WTFPL
 * @see FixedDateFunction
 */
class FixedDateFunctionTest extends TestCase
{
    /**
     * Tests getDate().
     */
    public function testGetDate()
    {
        $function = new FixedDateFunction(strtotime("2013-3-3"));
        $this->assertEquals("3. 3. 2013", call_user_func($function->getCallable(), "j. n. Y"));
        $this->assertEquals("24. 3. 2015", call_user_func($function->getCallable(), "j. n. Y", strtotime("2015-3-24")));
    }
}