|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
|
5
|
|
|
* @copyright Metaways Infosystems GmbH, 2013 |
|
6
|
|
|
* @copyright Aimeos (aimeos.org), 2014-2025 |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
namespace Aimeos\Base\Criteria\Plugin; |
|
11
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Test class for \Aimeos\Base\Criteria\Plugin\T3Salutation |
|
15
|
|
|
*/ |
|
16
|
|
|
class T3SalutationTest extends \PHPUnit\Framework\TestCase |
|
17
|
|
|
{ |
|
18
|
|
|
private $object; |
|
19
|
|
|
|
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Sets up the fixture. This method is called before a test is executed. |
|
23
|
|
|
*/ |
|
24
|
|
|
protected function setUp() : void |
|
25
|
|
|
{ |
|
26
|
|
|
$this->object = new \Aimeos\Base\Criteria\Plugin\T3Salutation(); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Tears down the fixture. This method is called after a test is executed. |
|
32
|
|
|
*/ |
|
33
|
|
|
protected function tearDown() : void |
|
34
|
|
|
{ |
|
35
|
|
|
unset( $this->object ); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
public function testTranslate() |
|
40
|
|
|
{ |
|
41
|
|
|
$this->assertEquals( 99, $this->object->translate( '' ) ); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
public function testTranslateMale() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->assertEquals( 0, $this->object->translate( 'mr' ) ); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
public function testTranslateFemale() |
|
52
|
|
|
{ |
|
53
|
|
|
$this->assertEquals( 1, $this->object->translate( 'ms' ) ); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
public function testTranslateCompany() |
|
58
|
|
|
{ |
|
59
|
|
|
$this->assertEquals( 10, $this->object->translate( 'company' ) ); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
|
|
63
|
|
|
public function testReverse() |
|
64
|
|
|
{ |
|
65
|
|
|
$this->assertEquals( '', $this->object->reverse( 99 ) ); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
|
|
69
|
|
|
public function testReverseMale() |
|
70
|
|
|
{ |
|
71
|
|
|
$this->assertEquals( 'mr', $this->object->reverse( 0 ) ); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
|
|
75
|
|
|
public function testReverseFemale() |
|
76
|
|
|
{ |
|
77
|
|
|
$this->assertEquals( 'ms', $this->object->reverse( 1 ) ); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
|
|
81
|
|
|
public function testReverseCompany() |
|
82
|
|
|
{ |
|
83
|
|
|
$this->assertEquals( 'company', $this->object->reverse( 10 ) ); |
|
84
|
|
|
} |
|
85
|
|
|
} |
|
86
|
|
|
|