Skip to content

Commit

Permalink
Switch test of attachment to always use integer as ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge committed Sep 13, 2019
1 parent e8e31bc commit b2d650b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Site
const SITE_ID = 'global_media.site_id';
const META_KEY_SITE_ID = 'global_media_site_id';

const SITE_ID_PREFIX_RIGHT_PAD = '00000';
const SITE_ID_PREFIX_RIGHT_PAD = 00000;

/**
* Return the ID of site that store the media files.
Expand Down
6 changes: 3 additions & 3 deletions tests/php/unit/AttachmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public function testPrepareAttachmentForJs()
$site
->expects($this->once())
->method('idSitePrefix')
->willReturn('1' . Site::SITE_ID_PREFIX_RIGHT_PAD);
->willReturn(1 . Site::SITE_ID_PREFIX_RIGHT_PAD);

$attachmentDataMock = [
'id' => 'ID',
'id' => '',
'editLink' => true,
'nonces' => [
'update' => true,
Expand All @@ -43,7 +43,7 @@ public function testPrepareAttachmentForJs()
],
];
$attachmentDataExpected = [
'id' => '1' . Site::SITE_ID_PREFIX_RIGHT_PAD . 'ID',
'id' => intval(1 . Site::SITE_ID_PREFIX_RIGHT_PAD),
'editLink' => false,
'nonces' => [
'update' => false,
Expand Down

0 comments on commit b2d650b

Please sign in to comment.