Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9503079
ArrayDisplayTest.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
ArrayDisplayTest.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\Commands\Tests\Display
;
use
Keruald\Commands\Display\ArrayDisplay
;
use
PHPUnit\Framework\TestCase
;
class
ArrayDisplayTest
extends
TestCase
{
/**
* @var ArrayDisplay
*/
private
$display
;
public
function
setUp
()
:
void
{
$this
->
display
=
new
ArrayDisplay
;
}
public
function
testOut
()
:
void
{
$this
->
display
->
out
(
"Hello world!"
);
$this
->
assertEquals
([
"Hello world!"
],
$this
->
display
->
getOut
());
$this
->
assertEquals
([],
$this
->
display
->
getError
());
$this
->
assertEquals
(
1
,
$this
->
display
->
countOut
());
$this
->
assertEquals
(
0
,
$this
->
display
->
countError
());
}
public
function
testClearOut
()
:
void
{
$this
->
display
->
out
(
"Lorem"
);
$this
->
display
->
out
(
"Ipsum"
);
$this
->
display
->
out
(
"Dolor"
);
$this
->
display
->
clearOut
();
$this
->
assertEquals
(
0
,
$this
->
display
->
countOut
());
}
public
function
testClearError
()
:
void
{
$this
->
display
->
error
(
"Lorem"
);
$this
->
display
->
error
(
"Ipsum"
);
$this
->
display
->
error
(
"Dolor"
);
$this
->
display
->
clearError
();
$this
->
assertEquals
(
0
,
$this
->
display
->
countError
());
}
public
function
testCountOut
()
:
void
{
$this
->
display
->
out
(
"Lorem"
);
$this
->
display
->
out
(
"Ipsum"
);
$this
->
display
->
out
(
"Dolor"
);
$this
->
assertEquals
(
3
,
$this
->
display
->
countOut
());
}
public
function
testCountError
()
:
void
{
$this
->
display
->
error
(
"Lorem"
);
$this
->
display
->
error
(
"Ipsum"
);
$this
->
display
->
error
(
"Dolor"
);
$this
->
assertEquals
(
3
,
$this
->
display
->
countError
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jun 8, 00:20 (6 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566900
Default Alt Text
ArrayDisplayTest.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment