77use Illuminate \Foundation \Testing \DatabaseTransactions ;
88use Illuminate \Support \Facades \Hash ;
99use ProcessMaker \Model \User ;
10- use ProcessMaker \Model \EnvironmentVariable ;
11-
10+ use ProcessMaker \Models \EnvironmentVariable ;
1211
1312class EnvironmentVariablesTest extends TestCase
1413{
@@ -117,12 +116,12 @@ public function it_should_successfully_return_an_environment_variable()
117116 ]);
118117 $ variable ->fresh ();
119118 // Is now fetch the variable and see if success
120- $ response = $ this ->api ('get ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uid );
119+ $ response = $ this ->api ('get ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uuid_text );
121120
122121 $ response ->assertStatus (200 );
123122
124123 $ response ->assertJsonStructure ([
125- 'uid ' ,
124+ 'uuid ' ,
126125 'name ' ,
127126 'description ' ,
128127 ]);
@@ -150,7 +149,7 @@ public function it_should_have_validation_errors_on_name_uniqueness_during_updat
150149 'description ' => 'testdescription ' ,
151150 'value ' => 'differentvalue '
152151 ];
153- $ response = $ this ->api ('PUT ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uid , $ data );
152+ $ response = $ this ->api ('PUT ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uuid_text , $ data );
154153
155154 // Check for validation error status code
156155 $ response ->assertStatus (422 );
@@ -170,11 +169,11 @@ public function it_should_successfully_update_an_environment_variable()
170169 'description ' => 'newdescription ' ,
171170 'value ' => 'newvalue '
172171 ];
173- $ response = $ this ->api ('PUT ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uid , $ data );
172+ $ response = $ this ->api ('PUT ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uuid_text , $ data );
174173
175174 $ response ->assertStatus (200 );
176175
177- $ data ['uid ' ] = $ variable ->uid ;
176+ $ data ['uuid ' ] = $ variable ->uuid ;
178177 unset($ data ['value ' ]);
179178 $ this ->assertDatabaseHas ('environment_variables ' , $ data );
180179
@@ -187,7 +186,7 @@ public function it_should_successfully_update_an_environment_variable()
187186 public function it_should_return_paginated_environment_variables_during_index ()
188187 {
189188 // Can't truncate because of DatabaseTransactions
190- EnvironmentVariable::whereNotNull ('id ' )->delete ();
189+ EnvironmentVariable::whereNotNull ('uuid ' )->delete ();
191190
192191 $ this ->withoutExceptionHandling ();
193192 factory (EnvironmentVariable::class, 50 )->create ();
@@ -229,7 +228,7 @@ public function it_should_successfully_remove_environment_variable()
229228 'value ' => 'testvalue '
230229 ]);
231230 $ variable ->fresh ();
232- $ response = $ this ->api ('DELETE ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uid );
231+ $ response = $ this ->api ('DELETE ' , self ::API_TEST_VARIABLES . '/ ' . $ variable ->uuid_text );
233232
234233 $ response ->assertStatus (200 );
235234
0 commit comments