diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index e001657e42..a28076591e 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -566,15 +566,15 @@ trait AccountBase /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_PUT, '/account/prefs', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, ]), [ 'prefs' => [ - 'key1' => 'value1', - 'key2' => 'value2', + 'prefKey1' => 'prefValue1', + 'prefKey2' => 'prefValue2', ] ]); @@ -582,13 +582,13 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']); - $this->assertEquals('value1', $response['body']['key1']); - $this->assertEquals('value2', $response['body']['key2']); + $this->assertEquals('prefValue1', $response['body']['prefKey1']); + $this->assertEquals('prefValue2', $response['body']['prefKey2']); /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PUT, '/account/prefs', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -596,7 +596,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 401); - $response = $this->client->call(Client::METHOD_PUT, '/account/prefs', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -608,7 +608,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 400); - $response = $this->client->call(Client::METHOD_PUT, '/account/prefs', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -619,7 +619,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 400); - $response = $this->client->call(Client::METHOD_PUT, '/account/prefs', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 9f33156c43..cf66784a19 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -24,9 +24,9 @@ class FunctionsConsoleClientTest extends Scope ], $this->getHeaders()), [ 'name' => 'Test', 'vars' => [ - 'key1' => 'value1', - 'key2' => 'value2', - 'key3' => 'value3', + 'funcKey1' => 'funcValue1', + 'funcKey2' => 'funcValue2', + 'funcKey3' => 'funcValue3', ], 'events' => [ 'account.create', diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index a09f4b14eb..c781244e20 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -26,9 +26,9 @@ class FunctionsConsoleServerTest extends Scope 'name' => 'Test', 'env' => 'php-7.4', 'vars' => [ - 'key1' => 'value1', - 'key2' => 'value2', - 'key3' => 'value3', + 'funcKey1' => 'funcValue1', + 'funcKey2' => 'funcValue2', + 'funcKey3' => 'funcValue3', ], 'events' => [ 'account.create', @@ -48,9 +48,9 @@ class FunctionsConsoleServerTest extends Scope $this->assertIsInt($response1['body']['dateUpdated']); $this->assertEquals('', $response1['body']['tag']); $this->assertEquals([ - 'key1' => 'value1', - 'key2' => 'value2', - 'key3' => 'value3', + 'funcKey1' => 'funcValue1', + 'funcKey2' => 'funcValue2', + 'funcKey3' => 'funcValue3', ], $response1['body']['vars']); $this->assertEquals([ 'account.create', diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index ca2d20185d..757ef0fdeb 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -132,24 +132,24 @@ trait UsersBase /** * Test for SUCCESS */ - $user = $this->client->call(Client::METHOD_PUT, '/users/' . $data['userId'] . '/prefs', array_merge([ + $user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/prefs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'prefs' => [ - 'key1' => 'value1', - 'key2' => 'value2', + 'funcKey1' => 'funcValue1', + 'funcKey2' => 'funcValue2', ], ]); $this->assertEquals($user['headers']['status-code'], 200); - $this->assertEquals($user['body']['key1'], 'value1'); - $this->assertEquals($user['body']['key2'], 'value2'); + $this->assertEquals($user['body']['funcKey1'], 'funcValue1'); + $this->assertEquals($user['body']['funcKey2'], 'funcValue2'); /** * Test for FAILURE */ - $user = $this->client->call(Client::METHOD_PUT, '/users/' . $data['userId'] . '/prefs', array_merge([ + $user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/prefs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -158,7 +158,7 @@ trait UsersBase $this->assertEquals($user['headers']['status-code'], 400); - $user = $this->client->call(Client::METHOD_PUT, '/users/' . $data['userId'] . '/prefs', array_merge([ + $user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/prefs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index cbcd1bdce1..0da4b81fb8 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -35,32 +35,32 @@ class EventTest extends TestCase public function testParams() { $this->object - ->setParam('key1', 'value1') - ->setParam('key2', 'value2') + ->setParam('eventKey1', 'eventValue1') + ->setParam('eventKey2', 'eventValue2') ; $this->object->trigger(); - $this->assertEquals(null, $this->object->getParam('key1')); - $this->assertEquals(null, $this->object->getParam('key2')); - $this->assertEquals(null, $this->object->getParam('key3')); + $this->assertEquals(null, $this->object->getParam('eventKey1')); + $this->assertEquals(null, $this->object->getParam('eventKey2')); + $this->assertEquals(null, $this->object->getParam('eventKey3')); $this->assertEquals(\Resque::size($this->queue), 1); } public function testReset() { $this->object - ->setParam('key1', 'value1') - ->setParam('key2', 'value2') + ->setParam('eventKey1', 'eventValue1') + ->setParam('eventKey2', 'eventValue2') ; - $this->assertEquals('value1', $this->object->getParam('key1')); - $this->assertEquals('value2', $this->object->getParam('key2')); + $this->assertEquals('eventValue1', $this->object->getParam('eventKey1')); + $this->assertEquals('eventValue2', $this->object->getParam('eventKey2')); $this->object->reset(); - $this->assertEquals(null, $this->object->getParam('key1')); - $this->assertEquals(null, $this->object->getParam('key2')); - $this->assertEquals(null, $this->object->getParam('key3')); + $this->assertEquals(null, $this->object->getParam('eventKey1')); + $this->assertEquals(null, $this->object->getParam('eventKey2')); + $this->assertEquals(null, $this->object->getParam('eventKey3')); } } \ No newline at end of file