4 * This file is part of Psy Shell.
6 * (c) 2012-2017 Justin Hileman
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Psy\Test\Readline;
14 use Psy\Readline\HoaConsole;
16 class HoaConsoleTest extends \PHPUnit_Framework_TestCase
18 public function testHistory()
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());