Skip to content

Commit 0b01e0f

Browse files
committed
Adds test for metadata to integration tests.
1 parent 6e86523 commit 0b01e0f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/integration-tests/compareToLocalCalls.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ final public function provideFiles()
7575
$localContents = $localResult->getContents();
7676
/** @var array $contents */
7777
$contents = $result->getContents();
78-
$this->compare($localContents, $contents);
78+
$this->validateLocalAdapterValuesArePresentInGithubAdapterValues($localContents, $contents);
7979
} elseif ($localResult instanceof \League\Flysystem\File) {
8080
/** @var $localResult \League\Flysystem\File */
8181
/** @var $result \League\Flysystem\File */
@@ -84,13 +84,14 @@ final public function provideFiles()
8484
self::assertEquals($localResult, $result);
8585
}
8686
}],
87+
'getMetadata' => ['callback' => [$this, 'validateLocalAdapterValuesArePresentInGithubAdapterValues']],
8788
'getMimetype' => [],
8889
'getSize' => [],
8990
//@FIXME: Synchronize local timestamp with remote git repo timestamp so "getTimestamp" can be tested
9091
// 'getTimestamp' => [],
9192
'getVisibility' => [],
9293
'has' => [],
93-
'listContents' => ['type' => 'dir', 'callback' => [$this, 'compare']],
94+
'listContents' => ['type' => 'dir', 'callback' => [$this, 'validateLocalAdapterValuesArePresentInGithubAdapterValues']],
9495
'read' => ['type' => 'file'],
9596
'readStream' => ['type' => 'file', 'callback' => function ($localStream, $githubStream){
9697
self::assertEquals(stream_get_contents($localStream), stream_get_contents($githubStream));
@@ -147,7 +148,7 @@ private function createFixture()
147148
* @param array $localContents
148149
* @param array $contents
149150
*/
150-
private function compare(array $localContents, array $contents)
151+
private function validateLocalAdapterValuesArePresentInGithubAdapterValues(array $localContents, array $contents)
151152
{
152153
array_walk($contents, 'ksort');
153154
array_walk($localContents, 'ksort');
@@ -159,7 +160,7 @@ private function compare(array $localContents, array $contents)
159160

160161
foreach ($localContents as $index => $localContent) {
161162
foreach ($localContent as $key => $value) {
162-
self::assertEquals($value, $contents[$index][$key]);
163+
self::assertEquals([$key => $value], [$key => $contents[$index][$key]]);
163164
}
164165
}
165166
}

0 commit comments

Comments
 (0)