Dieser Commit ist enthalten in:
Ursprung
2b21070b1a
Commit
f7a7c71f86
1583 geänderte Dateien mit 454759 neuen und 0 gelöschten Zeilen
35
tests/unit/application/views/helpers/ByteOutputTest.php
Normale Datei
35
tests/unit/application/views/helpers/ByteOutputTest.php
Normale Datei
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
require_once 'PHPUnit/Framework/TestCase.php';
|
||||
require_once 'ByteOutput.php';
|
||||
|
||||
/**
|
||||
* @group MsdViewHelper
|
||||
*/
|
||||
|
||||
class ByteOutputTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testByteOutputWithoutHtml()
|
||||
{
|
||||
$expected='1.00 KB';
|
||||
$viewHelper = new Msd_View_Helper_ByteOutput();
|
||||
$res = $viewHelper->byteOutput(1024, 2, false);
|
||||
$this->assertEquals($expected, $res);
|
||||
}
|
||||
|
||||
public function testByteOutputWithHtml()
|
||||
{
|
||||
$expected = '1.00 <span class="explain tooltip" title="KiloBytes">KB</span>';
|
||||
$viewHelper = new Msd_View_Helper_ByteOutput();
|
||||
$res = $viewHelper->byteOutput(1024, 2, true);
|
||||
$this->assertEquals($expected, $res);
|
||||
}
|
||||
|
||||
public function testByteOutputWithNonNumericValue()
|
||||
{
|
||||
$expected = 'I am not a number';
|
||||
$viewHelper = new Msd_View_Helper_ByteOutput();
|
||||
$res = $viewHelper->byteOutput($expected, 2, true);
|
||||
$this->assertEquals($expected, $res);
|
||||
}
|
||||
}
|
||||
|
||||
Laden …
Tabelle hinzufügen
Einen Link hinzufügen
In neuem Issue referenzieren