1 | <?php |
||
13 | class TestOfUtilUri extends UnitTestCase |
||
14 | { |
||
15 | public $MockCal; |
||
16 | |||
17 | /** |
||
18 | * TestOfUtilUri constructor. |
||
19 | */ |
||
20 | public function __construct() |
||
23 | } |
||
24 | |||
25 | public function setUp() |
||
26 | { |
||
27 | $this->MockCal = new Mock_Calendar_Day($this); |
||
28 | $this->MockCal->setReturnValue('getEngine', new Mock_Calendar_Engine($this)); |
||
29 | } |
||
30 | |||
31 | public function testFragments() |
||
32 | { |
||
33 | $Uri = new Calendar_Util_Uri('y', 'm', 'd', 'h', 'm', 's'); |
||
34 | $Uri->setFragments('year', 'month', 'day', 'hour', 'minute', 'second'); |
||
35 | $this->assertEqual('year=&month=&day=&hour=&minute=&second=', $Uri->this($this->MockCal, 'second')); |
||
36 | } |
||
37 | |||
38 | public function testScalarFragments() |
||
43 | } |
||
44 | |||
45 | public function testSetSeperator() |
||
50 | } |
||
51 | } |
||
52 | |||
58 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.