|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of PHP-Typography. |
|
4
|
|
|
* |
|
5
|
|
|
* Copyright 2017 Peter Putzer. |
|
6
|
|
|
* |
|
7
|
|
|
* This program is free software; you can redistribute it and/or |
|
8
|
|
|
* modify it under the terms of the GNU General Public License |
|
9
|
|
|
* as published by the Free Software Foundation; either version 2 |
|
10
|
|
|
* of the License, or ( at your option ) any later version. |
|
11
|
|
|
* |
|
12
|
|
|
* This program is distributed in the hope that it will be useful, |
|
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
* GNU General Public License for more details. |
|
16
|
|
|
* |
|
17
|
|
|
* You should have received a copy of the GNU General Public License |
|
18
|
|
|
* along with this program; if not, write to the Free Software |
|
19
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
20
|
|
|
* |
|
21
|
|
|
* @package mundschenk-at/php-typography/tests |
|
22
|
|
|
* @license http://www.gnu.org/licenses/gpl-2.0.html |
|
23
|
|
|
*/ |
|
24
|
|
|
|
|
25
|
|
|
namespace PHP_Typography\Tests\Settings; |
|
26
|
|
|
|
|
27
|
|
|
use \PHP_Typography\Tests\PHP_Typography_Testcase; |
|
28
|
|
|
|
|
29
|
|
|
use \PHP_Typography\Settings\Quotes; |
|
30
|
|
|
use \PHP_Typography\Settings\Simple_Quotes; |
|
31
|
|
|
use \PHP_Typography\U; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Simple_Quotes unit test. |
|
35
|
|
|
* |
|
36
|
|
|
* @coversDefaultClass \PHP_Typography\Settings\Simple_Quotes |
|
37
|
|
|
* @usesDefaultClass \PHP_Typography\Settings\Simple_Quotes |
|
38
|
|
|
* |
|
39
|
|
|
* @uses PHP_Typography\Settings\Simple_Quotes |
|
40
|
|
|
*/ |
|
41
|
|
|
class Simple_Quotes_Test extends PHP_Typography_Testcase { |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Provide data for testing the Simple_Quotes class. |
|
45
|
|
|
* |
|
46
|
|
|
* @return array |
|
47
|
|
|
*/ |
|
48
|
|
|
public function provide_simple_quotes_data() { |
|
49
|
|
|
return [ |
|
50
|
|
|
[ 'a', 'b' ], |
|
51
|
|
|
[ 'foo', 'bar' ], |
|
52
|
|
|
]; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Test the class. |
|
57
|
|
|
* |
|
58
|
|
|
* @covers ::__construct |
|
59
|
|
|
* @covers ::open |
|
60
|
|
|
* @covers ::close |
|
61
|
|
|
* |
|
62
|
|
|
* @dataProvider provide_simple_quotes_data |
|
63
|
|
|
* |
|
64
|
|
|
* @param string $open Required. |
|
65
|
|
|
* @param string $close Required. |
|
66
|
|
|
*/ |
|
67
|
|
|
public function test_simple_quotes( $open, $close ) { |
|
68
|
|
|
$quotes = new Simple_Quotes( $open, $close ); |
|
69
|
|
|
|
|
70
|
|
|
$this->assertSame( $open, $quotes->open() ); |
|
71
|
|
|
$this->assertSame( $close, $quotes->close() ); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|