1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @file |
5
|
|
|
* Grafizzi\Graph\Tests\SinkFilterTest: a component of the Grafizzi library. |
6
|
|
|
* |
7
|
|
|
* (c) 2012 Frédéric G. MARAND <[email protected]> |
8
|
|
|
* |
9
|
|
|
* Grafizzi is free software: you can redistribute it and/or modify it under the |
10
|
|
|
* terms of the GNU Lesser General Public License as published by the Free |
11
|
|
|
* Software Foundation, either version 3 of the License, or (at your option) any |
12
|
|
|
* later version. |
13
|
|
|
* |
14
|
|
|
* Grafizzi is distributed in the hope that it will be useful, but WITHOUT ANY |
15
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
16
|
|
|
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
17
|
|
|
* details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
20
|
|
|
* along with Grafizzi, in the COPYING.LESSER.txt file. If not, see |
21
|
|
|
* <http://www.gnu.org/licenses/> |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
namespace Grafizzi\Graph\Tests; |
25
|
|
|
|
26
|
|
|
require 'vendor/autoload.php'; |
27
|
|
|
|
28
|
|
|
use Grafizzi\Graph\Filter\SinkFilter; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* SinkFilter test case. |
32
|
|
|
*/ |
33
|
|
|
class SinkFilterTest extends BaseFilterTest { |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Prepares the environment before running a test. |
37
|
|
|
*/ |
38
|
|
|
protected function setUp() : void { |
39
|
|
|
parent::setUp(); |
40
|
|
|
$this->filters[] = new SinkFilter(); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Tests SinkFilter->filter() |
45
|
|
|
*/ |
46
|
|
|
public function testFilter() { |
47
|
|
|
$in = 'Sink test'; |
48
|
|
|
list($out, $err) = $this->filters[0]->filter($in); |
49
|
|
|
$this->assertEmpty($out, 'Sink filter drops content from stdout.'); |
50
|
|
|
$this->assertEmpty($err, 'Sink filter does not output errors.'); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|