mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Disable 2 way for ManyToOne relation test
This commit is contained in:
@@ -3468,7 +3468,6 @@ trait DatabasesBase
|
||||
'key' => 'artist',
|
||||
'twoWayKey' => 'albums',
|
||||
]);
|
||||
|
||||
$this->assertEquals(202, $response['headers']['status-code']);
|
||||
$this->assertEquals('artist', $response['body']['key']);
|
||||
$this->assertEquals('relationship', $response['body']['type']);
|
||||
@@ -3535,6 +3534,27 @@ trait DatabasesBase
|
||||
$this->assertEquals('Album 1', $artist['body']['albums'][0]['name']);
|
||||
$this->assertEquals($permissions, $artist['body']['albums'][0]['$permissions']);
|
||||
|
||||
// Update disable 2 way
|
||||
$relation = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $albums['body']['$id'] . '/attributes/artist/relationship', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'twoWay' => false,
|
||||
]);
|
||||
|
||||
|
||||
$this->assertEquals(202, $response['headers']['status-code']);
|
||||
$artist = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $artists['body']['$id'] . '/documents/' . $album['body']['artist']['$id'], array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $artist['headers']['status-code']);
|
||||
$this->assertEquals('Artist 1', $artist['body']['name']);
|
||||
$this->assertEquals($permissions, $artist['body']['$permissions']);
|
||||
$this->assertArrayNotHasKey("albums", $artist['body']);
|
||||
|
||||
return [
|
||||
'databaseId' => $databaseId,
|
||||
'albumsCollection' => $albums['body']['$id'],
|
||||
|
||||
Reference in New Issue
Block a user