7
7
use Doctrine \Common \Persistence \ObjectManager ;
8
8
use Doctrine \ORM \EntityRepository ;
9
9
10
+ /**
11
+ * Tests that tags are transformed correctly using the data transformer.
12
+ *
13
+ * See http://symfony.com/doc/current/testing/database.html
14
+ *
15
+ * @author Jonathan Boyer <[email protected] >
16
+ */
10
17
class TagArrayToStringTransformerTest extends \PHPUnit \Framework \TestCase
11
18
{
12
19
/**
@@ -70,7 +77,7 @@ public function testCreateTheRightAmountOfTagsWithTooManyCommas()
70
77
}
71
78
72
79
/**
73
- * Spaces at the end (and begining ) of a world shouldn't matter.
80
+ * Spaces at the end (and beginning ) of a world shouldn't matter.
74
81
*/
75
82
public function testTrimNames ()
76
83
{
@@ -92,26 +99,26 @@ public function testDuplicateNames()
92
99
*/
93
100
public function testUsesAlreadyDefinedTags ()
94
101
{
95
- $ persisted_tags = [
102
+ $ persistedTags = [
96
103
$ this ->createTag ('Hello ' ),
97
104
$ this ->createTag ('World ' ),
98
105
];
99
- $ tags = $ this ->getMockedTransformer ($ persisted_tags )->reverseTransform ('Hello, World, How, Are, You ' );
106
+ $ tags = $ this ->getMockedTransformer ($ persistedTags )->reverseTransform ('Hello, World, How, Are, You ' );
100
107
$ this ->assertCount (5 , $ tags );
101
- $ this ->assertSame ($ persisted_tags [0 ], $ tags [0 ]);
102
- $ this ->assertSame ($ persisted_tags [1 ], $ tags [1 ]);
108
+ $ this ->assertSame ($ persistedTags [0 ], $ tags [0 ]);
109
+ $ this ->assertSame ($ persistedTags [1 ], $ tags [1 ]);
103
110
}
104
111
105
112
/**
106
113
* Tags should be transformed into a string.
107
114
*/
108
115
public function testTransform ()
109
116
{
110
- $ persisted_tags = [
117
+ $ persistedTags = [
111
118
$ this ->createTag ('Hello ' ),
112
119
$ this ->createTag ('World ' ),
113
120
];
114
- $ transformed = $ this ->getMockedTransformer ()->transform ($ persisted_tags );
121
+ $ transformed = $ this ->getMockedTransformer ()->transform ($ persistedTags );
115
122
$ this ->assertSame ('Hello,World ' , $ transformed );
116
123
}
117
124
}
0 commit comments