mirror of
https://gh.wpcy.net/https://github.com/typisttech/image-optimize-command.git
synced 2026-05-24 20:00:42 +08:00
35 lines
770 B
PHP
35 lines
770 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TypistTech\ImageOptimizeCommand\CLI;
|
|
|
|
use Codeception\Test\Unit;
|
|
use Mockery;
|
|
use WP_Mock;
|
|
|
|
class LoggerFactoryTest extends Unit
|
|
{
|
|
/**
|
|
* @var \TypistTech\ImageOptimizeCommand\UnitTester
|
|
*/
|
|
protected $tester;
|
|
|
|
public function testCreate()
|
|
{
|
|
WP_Mock::userFunction(__NAMESPACE__ . '\apply_filters')
|
|
->with(
|
|
LoggerFactory::HOOK,
|
|
Mockery::type(Logger::class)
|
|
)
|
|
->andReturnUsing(function ($_hook, $arg) {
|
|
return $arg;
|
|
})
|
|
->once();
|
|
|
|
$actual = LoggerFactory::create();
|
|
|
|
$expected = new Logger();
|
|
$this->assertEquals($expected, $actual);
|
|
}
|
|
}
|