Yaffs site version 1.1
[yaffs-website] / vendor / psy / psysh / test / Psy / Test / Readline / HoaConsoleTest.php
1 <?php
2
3 /*
4  * This file is part of Psy Shell.
5  *
6  * (c) 2012-2017 Justin Hileman
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Psy\Test\Readline;
13
14 use Psy\Readline\HoaConsole;
15
16 class HoaConsoleTest extends \PHPUnit_Framework_TestCase
17 {
18     public function testHistory()
19     {
20         $readline = new HoaConsole();
21         $this->assertEmpty($readline->listHistory());
22         $readline->addHistory('foo');
23         $this->assertEquals(array('foo'), $readline->listHistory());
24         $readline->addHistory('bar');
25         $this->assertEquals(array('foo', 'bar'), $readline->listHistory());
26         $readline->addHistory('baz');
27         $this->assertEquals(array('foo', 'bar', 'baz'), $readline->listHistory());
28         $readline->clearHistory();
29         $this->assertEmpty($readline->listHistory());
30     }
31 }