mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: resolve additional merge corruptions in test files
- DatabasesBase.php: fix array indentation for 'library' key inside 'data' array - SitesBase.php: fix corrupted while-loop/assertEventually merge in activation check - DatabasesStringTypesTest.php: remove return $data from void methods, convert @depends chain to use setupDatabaseAndCollection() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
6c29f4e285
commit
9e628072eb
@@ -2990,13 +2990,13 @@ trait DatabasesBase
|
||||
'$databaseId' => 'some-other-database',
|
||||
'$createdAt' => '2024-01-01T00:00:00Z',
|
||||
'$updatedAt' => '2024-01-01T00:00:00Z',
|
||||
],
|
||||
'library' => [
|
||||
'$id' => 'library3',
|
||||
'libraryName' => 'Library 3',
|
||||
'$createdAt' => '2024-01-01T00:00:00Z',
|
||||
'$updatedAt' => '2024-01-01T00:00:00Z',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$update = $personNoPerm;
|
||||
|
||||
@@ -246,8 +246,6 @@ class DatabasesStringTypesTest extends Scope
|
||||
|
||||
$this->assertEquals(202, $varcharEncrypted['headers']['status-code']);
|
||||
$this->assertTrue($varcharEncrypted['body']['encrypt']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function testCreateVarcharAttributeFailures(): void
|
||||
@@ -410,8 +408,6 @@ class DatabasesStringTypesTest extends Scope
|
||||
|
||||
$this->assertEquals(202, $textEncrypted['headers']['status-code']);
|
||||
$this->assertTrue($textEncrypted['body']['encrypt']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function testCreateMediumtextAttribute(): void
|
||||
@@ -474,8 +470,6 @@ class DatabasesStringTypesTest extends Scope
|
||||
|
||||
$this->assertEquals(202, $mediumtextEncrypted['headers']['status-code']);
|
||||
$this->assertTrue($mediumtextEncrypted['body']['encrypt']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function testCreateLongtextAttribute(): void
|
||||
@@ -538,15 +532,11 @@ class DatabasesStringTypesTest extends Scope
|
||||
|
||||
$this->assertEquals(202, $longtextEncrypted['headers']['status-code']);
|
||||
$this->assertTrue($longtextEncrypted['body']['encrypt']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateLongtextAttribute
|
||||
*/
|
||||
public function testListStringTypeAttributes(array $data): array
|
||||
public function testListStringTypeAttributes(): void
|
||||
{
|
||||
$data = $this->setupDatabaseAndCollection();
|
||||
$databaseId = $data['databaseId'];
|
||||
$collectionId = $data['collectionId'];
|
||||
|
||||
@@ -568,15 +558,11 @@ class DatabasesStringTypesTest extends Scope
|
||||
$this->assertContains('text', $types);
|
||||
$this->assertContains('mediumtext', $types);
|
||||
$this->assertContains('longtext', $types);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testListStringTypeAttributes
|
||||
*/
|
||||
public function testGetCollectionWithStringTypeAttributes(array $data): array
|
||||
public function testGetCollectionWithStringTypeAttributes(): void
|
||||
{
|
||||
$data = $this->setupDatabaseAndCollection();
|
||||
$databaseId = $data['databaseId'];
|
||||
$collectionId = $data['collectionId'];
|
||||
|
||||
@@ -595,14 +581,9 @@ class DatabasesStringTypesTest extends Scope
|
||||
$this->assertContains('text', $types);
|
||||
$this->assertContains('mediumtext', $types);
|
||||
$this->assertContains('longtext', $types);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetCollectionWithStringTypeAttributes
|
||||
*/
|
||||
public function testUpdateVarcharAttribute(array $data): array
|
||||
public function testUpdateVarcharAttribute(): void
|
||||
{
|
||||
$this->markTestSkipped('Skipped until utopia-php/database updateAttribute supports VARCHAR type');
|
||||
}
|
||||
|
||||
@@ -69,12 +69,7 @@ trait SitesBase
|
||||
|
||||
// Not === so multipart/form-data works fine too
|
||||
if (($params['activate'] ?? false) == true) {
|
||||
// Wait briefly for auto-activation, then explicitly activate if needed
|
||||
$activated = false;
|
||||
$autoActivateTimeout = 30000; // 30 seconds for auto-activation
|
||||
$start = \microtime(true);
|
||||
|
||||
while ((\microtime(true) - $start) * 1000 < $autoActivateTimeout) {
|
||||
$this->assertEventually(function () use ($siteId, $deploymentId) {
|
||||
$site = $this->client->call(Client::METHOD_GET, '/sites/' . $siteId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
||||
Reference in New Issue
Block a user