Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12239353
DockerHubImageTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
DockerHubImageTest.php
View Options
<?php
namespace
Keruald\DockerHub\Tests
;
use
Keruald\DockerHub\DockerHubImage
;
use
Keruald\DockerHub\Build\TriggerBuild
;
use
PHPUnit\Framework\TestCase
;
class
DockerHubImageTest
extends
TestCase
{
use
WithMockHttpClient
;
/**
* @var Keruald\DockerHub\DockerHubImage
*/
private
$image
;
public
function
setUp
()
:
void
{
$this
->
image
=
new
DockerHubImage
(
"acme"
,
"foo"
);
}
public
function
testLoadFromSlashNotation
()
{
$slashNotationImage
=
DockerHubImage
::
loadFromSlashNotation
(
"acme/foo"
);
$this
->
assertEquals
(
$slashNotationImage
,
$this
->
image
);
}
public
function
testLoadFromSlashNotationWithInvalidArgument
()
{
$this
->
expectException
(
\Exception
::
class
);
DockerHubImage
::
loadFromSlashNotation
(
"foo"
);
}
public
function
testGetRegistryUrl
()
{
$this
->
assertSame
(
"https://registry.hub.docker.com/u/acme/foo"
,
$this
->
image
->
getRegistryUrl
()
);
}
public
function
testGetTriggerBuild
()
{
$client
=
self
::
mockHttpClient
(
200
);
$this
->
assertInstanceOf
(
TriggerBuild
::
class
,
$this
->
image
->
getTriggerBuild
(
$client
,
'0000'
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 11, 21:23 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064073
Default Alt Text
DockerHubImageTest.php (1 KB)
Attached To
Mode
rKDOCKERHUB Keruald Docker Hub
Attached
Detach File
Event Timeline
Log In to Comment