for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\Newsletter\Test;
use Spatie\Newsletter\NullDriver;
use Illuminate\Support\Facades\Log;
class NullDriverTest extends \PHPUnit\Framework\TestCase
{
protected function tearDown(): void
parent::tearDown();
\Mockery::close();
}
/** @test */
public function it_logs_the_method_call_when_log_is_set()
$subject = new NullDriver(true);
$log = \Mockery::mock();
Log::swap($log);
$log->shouldReceive('debug')->twice();
$this->assertNull($subject->unsubscribe('[email protected]', 'test list'));
$this->assertNull($subject->addTags(['tags'], '[email protected]'));
$log->shouldHaveReceived(
'debug', ['Called Spatie Newsletter facade method: unsubscribe with:', ['[email protected]', 'test list']]
);
'debug',
['Called Spatie Newsletter facade method: addTags with:', [['tags'], '[email protected]']]