@@ -56,29 +56,29 @@ public function testMimeType(): void
5656
5757 public function testAddProviderGivesPriorityToNewlyAddedProvider ()
5858 {
59- $ this ->faker ->addProvider (new FooProvider ());
60- $ this ->faker ->addProvider (new BarProvider ());
59+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
60+ $ this ->faker ->addProvider (new Fixture \ Provider \ BarProvider ());
6161 self ::assertEquals ('barfoo ' , $ this ->faker ->format ('fooFormatter ' ));
6262 }
6363
6464 public function testGetProvidersReturnsCorrectProviders ()
6565 {
66- $ this ->faker ->addProvider (new FooProvider ());
67- $ this ->faker ->addProvider (new BarProvider ());
68- self ::assertInstanceOf (FooProvider::class, $ this ->faker ->getProviders ()[1 ]);
69- self ::assertInstanceOf (BarProvider::class, $ this ->faker ->getProviders ()[0 ]);
66+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
67+ $ this ->faker ->addProvider (new Fixture \ Provider \ BarProvider ());
68+ self ::assertInstanceOf (Fixture \ Provider \ FooProvider::class, $ this ->faker ->getProviders ()[1 ]);
69+ self ::assertInstanceOf (Fixture \ Provider \ BarProvider::class, $ this ->faker ->getProviders ()[0 ]);
7070 self ::assertCount (2 , $ this ->faker ->getProviders ());
7171 }
7272
7373 public function testGetFormatterReturnsCallable ()
7474 {
75- $ this ->faker ->addProvider (new FooProvider ());
75+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
7676 self ::assertIsCallable ($ this ->faker ->getFormatter ('fooFormatter ' ));
7777 }
7878
7979 public function testGetFormatterReturnsCorrectFormatter ()
8080 {
81- $ provider = new FooProvider ();
81+ $ provider = new Fixture \ Provider \ FooProvider ();
8282 $ this ->faker ->addProvider ($ provider );
8383 $ expected = [$ provider , 'fooFormatter ' ];
8484 self ::assertEquals ($ expected , $ this ->faker ->getFormatter ('fooFormatter ' ));
@@ -93,20 +93,20 @@ public function testGetFormatterThrowsExceptionOnIncorrectProvider()
9393 public function testGetFormatterThrowsExceptionOnIncorrectFormatter ()
9494 {
9595 $ this ->expectException (\InvalidArgumentException::class);
96- $ this ->faker ->addProvider (new FooProvider ());
96+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
9797 $ this ->faker ->getFormatter ('barFormatter ' );
9898 }
9999
100100 public function testFormatCallsFormatterOnProvider ()
101101 {
102- $ this ->faker ->addProvider (new FooProvider ());
102+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
103103 self ::assertEquals ('foobar ' , $ this ->faker ->format ('fooFormatter ' ));
104104 }
105105
106106 public function testFormatTransfersArgumentsToFormatter ()
107107 {
108108 $ this ->faker = new Generator ();
109- $ provider = new FooProvider ();
109+ $ provider = new Fixture \ Provider \ FooProvider ();
110110 $ this ->faker ->addProvider ($ provider );
111111 self ::assertEquals ('bazfoo ' , $ this ->faker ->format ('fooFormatterWithArguments ' , ['foo ' ]));
112112 }
@@ -118,7 +118,7 @@ public function testParseReturnsSameStringWhenItContainsNoCurlyBraces()
118118
119119 public function testParseReturnsStringWithTokensReplacedByFormatters ()
120120 {
121- $ this ->faker ->addProvider (new FooProvider ());
121+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
122122 self ::assertEquals ('This is foobar a text with foobar ' , $ this ->faker ->parse ('This is {{fooFormatter}} a text with {{ fooFormatter }} ' ));
123123 }
124124
@@ -127,19 +127,19 @@ public function testParseReturnsStringWithTokensReplacedByFormatters()
127127 */
128128 public function testMagicGetCallsFormat ()
129129 {
130- $ this ->faker ->addProvider (new FooProvider ());
130+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
131131 self ::assertEquals ('foobar ' , $ this ->faker ->fooFormatter );
132132 }
133133
134134 public function testMagicCallCallsFormat ()
135135 {
136- $ this ->faker ->addProvider (new FooProvider ());
136+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
137137 self ::assertEquals ('foobar ' , $ this ->faker ->fooFormatter ());
138138 }
139139
140140 public function testMagicCallCallsFormatWithArguments ()
141141 {
142- $ this ->faker ->addProvider (new FooProvider ());
142+ $ this ->faker ->addProvider (new Fixture \ Provider \ FooProvider ());
143143 self ::assertEquals ('bazfoo ' , $ this ->faker ->fooFormatterWithArguments ('foo ' ));
144144 }
145145
@@ -285,24 +285,3 @@ public function word(): string
285285 $ uniqueGenerator ->word ();
286286 }
287287}
288-
289- final class FooProvider
290- {
291- public function fooFormatter ()
292- {
293- return 'foobar ' ;
294- }
295-
296- public function fooFormatterWithArguments ($ value = '' )
297- {
298- return 'baz ' . $ value ;
299- }
300- }
301-
302- final class BarProvider
303- {
304- public function fooFormatter ()
305- {
306- return 'barfoo ' ;
307- }
308- }
0 commit comments