for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TraderInteractiveTest\Exceptions;
use PHPUnit\Framework\TestCase;
use TraderInteractive\Exceptions\ExceptionWithContext;
/**
* @coversDefaultClass \TraderInteractive\Exceptions\ExceptionWithContext
*/
final class ExceptionWithContextTest extends TestCase
{
* @test
* @covers ::getContext
*
* @return void
public function contextIsOptional()
$this->assertSame([], (new ExceptionWithContext('a message'))->getContext());
}
public function getContextReturnsExpectedValues()
$context = ['foo' => 'bar'];
$this->assertSame($context, (new ExceptionWithContext('a message', $context))->getContext());
* @covers ::__construct
public function exceptionInheritsParentProperties()
$this->assertSame(2, (new ExceptionWithContext('a message', [], 2))->getCode());