Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F41924562
TommyTest.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
TommyTest.php
View Options
<?php
require_once
'traits/assertHttp.php'
;
class
TommyTest
extends
PHPUnit\Framework\TestCase
{
use
assertHttp
;
/**
* @dataProvider provideTommyInstances
*/
public
function
testIsLive
(
string
$url
)
{
$this
->
assertHttpResponseCode
(
200
,
$url
,
'Tommy looks down.'
);
$this
->
assertHttpResponseCode
(
404
,
$url
.
'/notexisting'
,
'A 404 code were expected for a not existing page.'
);
}
/**
* @dataProvider provideTommyInstances
*/
public
function
testAlive
(
string
$url
)
{
$url
=
$url
.
'/status'
;
$this
->
assertHttpResponseCode
(
200
,
$url
);
$this
->
assertSame
(
'ALIVE'
,
file_get_contents
(
$url
));
}
/**
* @dataProvider provideTommyInstances
*/
public
function
testDashboard
(
string
$url
,
string
$instance
)
{
$content
=
file_get_contents
(
$url
.
''
);
$this
->
assertContains
(
$instance
.
'/job/'
,
$content
);
}
///
/// Data providers
///
public
function
provideTommyInstances
()
:
iterable
{
yield
[
"https://builds.nasqueron.org"
,
"ci.nasqueron.org"
];
yield
[
"https://infra.nasqueron.org/cd/dashboard"
,
"cd.nasqueron.org"
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Aug 8, 03:09 (17 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3945727
Default Alt Text
TommyTest.php (1 KB)
Attached To
Mode
rTESTSPRODENV Test suite for operations: prod-environment-behaves-correctly
Attached
Detach File
Event Timeline
Log In to Comment