Skip to content

Commit

Permalink
test: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
shpran committed Oct 12, 2022
1 parent f86fa25 commit bcbeaee
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions test/unit/model/sharedStimulus/service/CopyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,34 @@ public function testSuccessfulCopy(): void
->expects($this->once())
->method('getList')
->willReturnCallback(function (ListStylesheets $dto) {
if ($dto->getUri() != 'http://example.com/resource1') {
if ($dto->getUri() !== 'http://example.com/resource1') {
$this->fail(
"Unexpected call to getList for URI {$dto->getUri()}"
);
}
})
->willReturn(['cssBasename1', 'cssBasename2']);
->willReturn([
'path' => DIRECTORY_SEPARATOR,
'label' => 'Passage stylesheets',
'childrenLimit' => 100,
'total' => 2,
'children' => [
[
'name' => 'cssBasename1',
'uri' => DIRECTORY_SEPARATOR . 'cssBasename1',
'mime' => 'text/css',
'filePath' => DIRECTORY_SEPARATOR . 'cssBasename1',
'size' => 100,
],
[
'name' => 'cssBasename2',
'uri' => DIRECTORY_SEPARATOR . 'cssBasename2',
'mime' => 'text/css',
'filePath' => DIRECTORY_SEPARATOR . 'cssBasename2',
'size' => 200,
],
],
]);

$this->tempFileWriter
->expects($this->exactly(2))
Expand Down

0 comments on commit bcbeaee

Please sign in to comment.