for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mezon\Service\Tests;
use PHPUnit\Framework\TestCase;
use Mezon\Security\MockProvider;
use Mezon\Service\Tests\Mocks\TestingTransport;
/**
* Class ServiceUnitTests
*
* @package Service
* @subpackage ServiceUnitTests
* @author Dodonov A.A.
* @version v.1.0 (2019/08/17)
* @copyright Copyright (c) 2019, aeon.org
*/
* Common service unit tests
* @psalm-suppress PropertyNotSetInConstructor
class ServiceUnitTests extends TestCase
{
* Testing method
public function testExceptionWhileConstruction(): void
// setup and test body
ob_start();
new ExceptionTestingService(new TestingTransport(new MockProvider()));
$content = ob_get_contents();
ob_end_clean();
// assertions
$this->assertStringContainsString("message", $content);
$this->assertStringContainsString("code", $content);
$this->assertTrue(is_array(json_decode($content, true)));
}