33namespace Stfn \RandomHash \Tests ;
44
55use PHPUnit \Framework \TestCase ;
6+ use Stfn \RandomHash \HashConfig ;
67use Stfn \RandomHash \InvalidConfigException ;
78use Stfn \RandomHash \RandomHash ;
8- use Stfn \RandomHash \HashConfig ;
99
1010class RandomHashTest extends TestCase
1111{
@@ -28,33 +28,33 @@ public function test_if_it_can_generate_hash_with_specific_length()
2828 public function test_if_it_can_generate_hash_with_specific_prefix ()
2929 {
3030 $ config = new HashConfig ();
31- $ config ->prefix (" PREFIX " );
31+ $ config ->prefix (' PREFIX ' );
3232
3333 $ instance = new RandomHash ($ config );
3434 $ hash = $ instance ->generate ();
3535
36- $ this ->assertStringStartsWith (" PREFIX " , $ hash );
36+ $ this ->assertStringStartsWith (' PREFIX ' , $ hash );
3737
38- $ config ->prefix (" NEW_PREFIX " );
38+ $ config ->prefix (' NEW_PREFIX ' );
3939 $ hash = $ instance ->generate ();
4040
41- $ this ->assertStringStartsWith (" NEW_PREFIX " , $ hash );
41+ $ this ->assertStringStartsWith (' NEW_PREFIX ' , $ hash );
4242 }
4343
4444 public function test_if_it_can_generate_hash_with_specific_suffix ()
4545 {
4646 $ config = new HashConfig ();
47- $ config ->suffix (" SUFFIX " );
47+ $ config ->suffix (' SUFFIX ' );
4848
4949 $ instance = new RandomHash ($ config );
5050 $ hash = $ instance ->generate ();
5151
52- $ this ->assertStringEndsWith (" SUFFIX " , $ hash );
52+ $ this ->assertStringEndsWith (' SUFFIX ' , $ hash );
5353
54- $ config ->suffix (" NEW_SUFFIX " );
54+ $ config ->suffix (' NEW_SUFFIX ' );
5555 $ hash = $ instance ->generate ();
5656
57- $ this ->assertStringEndsWith (" NEW_SUFFIX " , $ hash );
57+ $ this ->assertStringEndsWith (' NEW_SUFFIX ' , $ hash );
5858 }
5959
6060 public function test_if_it_can_generate_hash_with_specific_count ()
@@ -123,7 +123,7 @@ public function test_if_it_can_generate_alphanumeric()
123123 {
124124 $ config = new HashConfig ();
125125 $ config ->length (10 )
126- ->charset (HashConfig::CHARSET_UPPERCASE . HashConfig::CHARSET_LOWERCASE . HashConfig::CHARSET_NUMERIC );
126+ ->charset (HashConfig::CHARSET_UPPERCASE . HashConfig::CHARSET_LOWERCASE . HashConfig::CHARSET_NUMERIC );
127127
128128 $ instance = new RandomHash ($ config );
129129 $ hash = $ instance ->generate ();
@@ -173,7 +173,7 @@ public function test_if_it_can_generate_hashes_from_array_config()
173173 $ hashes = RandomHash::fromConfig ([
174174 'length ' => 12 ,
175175 'prefix ' => $ prefix ,
176- 'count ' => 10
176+ 'count ' => 10 ,
177177 ])->generate ();
178178
179179 $ this ->assertStringStartsWith ($ prefix , $ hashes [0 ]);
0 commit comments