4 * This file is part of Psy Shell.
6 * (c) 2012-2018 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\Exception;
14 use Psy\Exception\BreakException;
16 class BreakExceptionTest extends \PHPUnit\Framework\TestCase
18 public function testInstance()
20 $e = new BreakException();
22 $this->assertInstanceOf('Psy\Exception\Exception', $e);
23 $this->assertInstanceOf('Psy\Exception\BreakException', $e);
26 public function testMessage()
28 $e = new BreakException('foo');
30 $this->assertContains('foo', $e->getMessage());
31 $this->assertSame('foo', $e->getRawMessage());
35 * @expectedException \Psy\Exception\BreakException
36 * @expectedExceptionMessage Goodbye
38 public function testExitShell()
40 BreakException::exitShell();