for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Apicart\FQL\Tests\Generator\Common;
use Apicart\FQL\Generator\Common\Aggregate;
use Apicart\FQL\Value\AbstractNode;
use PHPUnit\Framework\TestCase;
use RuntimeException;
final class AggregateTest extends TestCase
{
public function testAccept(): void
/** @var AbstractNode $nodeMock */
$nodeMock = $this->getMockBuilder(AbstractNode::class)->getMock();
self::assertTrue((new Aggregate)->accept($nodeMock));
}
public function testVisitThrowsException(): void
self::expectException(RuntimeException::class);
PHPUnit\Framework\TestCase::expectException()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
self::/** @scrutinizer ignore-call */
expectException(RuntimeException::class);
self::expectExceptionMessage('No visitor available for Mock');
PHPUnit\Framework\TestCa...xpectExceptionMessage()
expectExceptionMessage('No visitor available for Mock');
(new Aggregate)->visit($nodeMock);