diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-05 23:30:56 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-05 23:30:56 -0400 |
commit | 710f2c7bb046b43ec9878ae795a181101f6d7515 (patch) | |
tree | b62723b6b49c3b6bf2b3ca41a772f552464a9031 /tests/units/TextHelperTest.php | |
parent | 94b38dd94bd819168163003beec8ef693f9d9839 (diff) |
Improve unit tests
Diffstat (limited to 'tests/units/TextHelperTest.php')
-rw-r--r-- | tests/units/TextHelperTest.php | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/tests/units/TextHelperTest.php b/tests/units/TextHelperTest.php deleted file mode 100644 index 95c83e57..00000000 --- a/tests/units/TextHelperTest.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -require_once __DIR__.'/Base.php'; - -use Helper\Text; - -class TextHelperTest extends Base -{ - public function testMarkdown() - { - $h = new Text($this->container); - - $this->assertEquals('<p>Test</p>', $h->markdown('Test')); - - $this->assertEquals( - '<p>Task #123</p>', - $h->markdown('Task #123') - ); - - $this->assertEquals( - '<p>Task <a href="?controller=a&action=b&c=d&task_id=123">#123</a></p>', - $h->markdown('Task #123', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))) - ); - - $this->assertEquals( - '<p>Check that: <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454</a></p>', - $h->markdown( - 'Check that: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454', - array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd')) - ) - ); - } - - public function testFormatBytes() - { - $h = new Text($this->container); - - $this->assertEquals('1k', $h->bytes(1024)); - $this->assertEquals('33.71k', $h->bytes(34520)); - } - - public function testContains() - { - $h = new Text($this->container); - - $this->assertTrue($h->contains('abc', 'b')); - $this->assertFalse($h->contains('abc', 'd')); - } - - public function testInList() - { - $h = new Text($this->container); - $this->assertEquals('?', $h->in('a', array('b' => 'c'))); - $this->assertEquals('c', $h->in('b', array('b' => 'c'))); - } -} |