mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
some tests
This commit is contained in:
1 parent
fa208bf31c
commit
94e2e5e71c
2 files changed
+9
-3
No files matched your search
@@ -498,7 +498,6 @@ class MongoClient
|
||||
], $options)
|
||||
);
|
||||
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
+9
-2
@@ -3,6 +3,7 @@
|
||||
namespace Utopia\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Mongo\MongoClient;
|
||||
use Utopia\Mongo\MongoClientOptions;
|
||||
|
||||
@@ -54,11 +55,17 @@ class MongoTest extends TestCase
|
||||
'language' => 'English'
|
||||
]
|
||||
);
|
||||
self::assertEquals(24, strlen((string)$doc['_id']));
|
||||
$id = (string)$doc['_id'];
|
||||
self::assertEquals(24, strlen($id));
|
||||
|
||||
$doc = $this->getDatabase()->find('movies', ['name' => 'Armageddon'])->cursor->firstBatch ?? [];
|
||||
//todo:make this work search by id
|
||||
//$doc = $this->getDatabase()->find('movies', ['_id' => 'ObjectId("'.$id.'") '])->cursor->firstBatch ?? [];
|
||||
|
||||
|
||||
$doc = $this->getDatabase()->insert('movies', ['9 Monkeys']);
|
||||
self::assertEquals(24, strlen((string)$doc['_id']));
|
||||
$id = (string)$doc['_id'];
|
||||
self::assertEquals(24, strlen($id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user