|
30 | 30 | ];
|
31 | 31 |
|
32 | 32 | $config = $this->arangoClient->getConfig();
|
33 |
| - $this->assertSame($defaultConfig, $config); |
| 33 | + expect($config)->toBe($defaultConfig); |
34 | 34 | });
|
35 | 35 |
|
36 | 36 | test('get config with endpoint without host port', function () {
|
|
40 | 40 | ];
|
41 | 41 |
|
42 | 42 | $returnedConfig = $this->arangoClient->getConfig();
|
43 |
| - $this->assertSame($config['endpoint'], $returnedConfig['endpoint']); |
| 43 | + expect($returnedConfig['endpoint'])->toBe($config['endpoint']); |
44 | 44 | });
|
45 | 45 |
|
46 | 46 | test('client with host port config', function () {
|
|
52 | 52 | $client = new ArangoClient($config);
|
53 | 53 | $retrievedConfig = $client->getConfig();
|
54 | 54 |
|
55 |
| - $this->assertEquals('http://127.0.0.1:1234', $retrievedConfig['endpoint']); |
| 55 | + expect($retrievedConfig['endpoint'])->toEqual('http://127.0.0.1:1234'); |
56 | 56 | });
|
57 | 57 |
|
58 | 58 | test('config with alien properties', function () {
|
|
77 | 77 | $this->arangoClient->setHttpClient($newClient);
|
78 | 78 | $retrievedClient = $this->arangoClient->getHttpClient();
|
79 | 79 |
|
80 |
| - $this->assertInstanceOf(Client::class, $oldClient); |
81 |
| - $this->assertEquals($newClient::class, $retrievedClient::class); |
| 80 | + expect($oldClient)->toBeInstanceOf(Client::class); |
| 81 | + expect($retrievedClient::class)->toEqual($newClient::class); |
82 | 82 | });
|
83 | 83 |
|
84 | 84 | test('request', function () {
|
85 | 85 | $result = $this->arangoClient->request('get', '/_api/version', []);
|
86 | 86 |
|
87 |
| - $this->assertSame('arango', $result->server); |
88 |
| - $this->assertSame('community', $result->license); |
89 |
| - $this->assertIsString($result->version); |
| 87 | + expect($result->server)->toBe('arango'); |
| 88 | + expect($result->license)->toBe('community'); |
| 89 | + expect($result->version)->toBeString(); |
90 | 90 | });
|
91 | 91 |
|
92 | 92 | test('get user', function () {
|
93 | 93 | $user = $this->arangoClient->getUser();
|
94 |
| - $this->assertSame('root', $user); |
| 94 | + expect($user)->toBe('root'); |
95 | 95 | });
|
96 | 96 |
|
97 | 97 | test('set and get database name', function () {
|
98 | 98 | $database = $this->arangoClient->getDatabase();
|
99 |
| - $this->assertSame($this->testDatabaseName, $database); |
| 99 | + expect($database)->toBe($this->testDatabaseName); |
100 | 100 |
|
101 | 101 | $newDatabaseName = 'ArangoClientDB';
|
102 | 102 | $this->arangoClient->setDatabase($newDatabaseName);
|
103 | 103 |
|
104 | 104 | $database = $this->arangoClient->getDatabase();
|
105 |
| - $this->assertSame($newDatabaseName, $database); |
| 105 | + expect($database)->toBe($newDatabaseName); |
106 | 106 | });
|
107 | 107 |
|
108 | 108 | test('database name is used in requests', function () {
|
|
126 | 126 | $this->arangoClient->request('get', $uri, ['handler' => $handlerStack]);
|
127 | 127 |
|
128 | 128 | foreach ($container as $transaction) {
|
129 |
| - $this->assertSame('/_db/' . $database . $uri, $transaction['request']->getUri()->getPath()); |
| 129 | + expect($transaction['request']->getUri()->getPath())->toBe('/_db/' . $database . $uri); |
130 | 130 | }
|
131 | 131 |
|
132 | 132 | $this->arangoClient->schema()->deleteDatabase($database);
|
133 | 133 | });
|
134 | 134 |
|
135 | 135 | test('schema', function () {
|
136 | 136 | $result = $this->arangoClient->schema();
|
137 |
| - $this->assertInstanceOf(SchemaManager::class, $result); |
| 137 | + expect($result)->toBeInstanceOf(SchemaManager::class); |
138 | 138 |
|
139 | 139 | $database = $this->arangoClient->schema()->getCurrentDatabase();
|
140 | 140 |
|
|
143 | 143 |
|
144 | 144 | test('admin', function () {
|
145 | 145 | $result = $this->arangoClient->admin();
|
146 |
| - $this->assertInstanceOf(AdminManager::class, $result); |
| 146 | + expect($result)->toBeInstanceOf(AdminManager::class); |
147 | 147 |
|
148 | 148 | $version = $this->arangoClient->admin()->getVersion();
|
149 | 149 |
|
|
153 | 153 | test('prepare', function () {
|
154 | 154 | $statement = $this->arangoClient->prepare('FOR doc IN users RETURN doc');
|
155 | 155 |
|
156 |
| - $this->assertInstanceOf(Statement::class, $statement); |
| 156 | + expect($statement)->toBeInstanceOf(Statement::class); |
157 | 157 | });
|
158 | 158 |
|
159 | 159 | test('connection protocol version', function () {
|
|
165 | 165 | $options['version'] = 2;
|
166 | 166 | $response = $this->arangoClient->debugRequest('get', $uri, $options);
|
167 | 167 |
|
168 |
| - $this->assertEquals(2, $response->getProtocolVersion()); |
| 168 | + expect($response->getProtocolVersion())->toEqual(2); |
169 | 169 | });
|
170 | 170 |
|
171 | 171 | test('connection protocol version with default setting', function () {
|
|
179 | 179 | $options['version'] = 2;
|
180 | 180 | $response = $this->arangoClient->debugRequest('get', $uri, $options);
|
181 | 181 |
|
182 |
| - $this->assertEquals(2, $response->getProtocolVersion()); |
| 182 | + expect($response->getProtocolVersion())->toEqual(2); |
183 | 183 | });
|
184 | 184 |
|
185 | 185 | test('json encode', function () {
|
186 | 186 | $results = $this->arangoClient->jsonEncode([]);
|
187 | 187 |
|
188 |
| - $this->assertSame('{}', $results); |
| 188 | + expect($results)->toBe('{}'); |
189 | 189 | });
|
190 | 190 |
|
191 | 191 | test('json encode empty array', function () {
|
192 | 192 | $results = $this->arangoClient->jsonEncode([]);
|
193 | 193 |
|
194 |
| - $this->assertSame('{}', $results); |
| 194 | + expect($results)->toBe('{}'); |
195 | 195 | });
|
196 | 196 |
|
197 | 197 | test('json encode empty string', function () {
|
198 | 198 | $results = $this->arangoClient->jsonEncode('');
|
199 | 199 |
|
200 |
| - $this->assertSame('""', $results); |
| 200 | + expect($results)->toBe('""'); |
201 | 201 | });
|
202 | 202 |
|
203 | 203 | test('json encode invalid data', function () {
|
|
230 | 230 | $statement->execute();
|
231 | 231 | $users = $statement->fetchAll();
|
232 | 232 |
|
233 |
| - $this->assertEquals($insertResult[0], $users[0]); |
| 233 | + expect($users[0])->toEqual($insertResult[0]); |
234 | 234 |
|
235 | 235 | $this->schemaManager->deleteCollection($collection);
|
236 | 236 | });
|
|
0 commit comments