for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Monolog\Handler\NoopHandler;
use Zend\ServiceManager\Factory\InvokableFactory;
use Zend\ServiceManager\ServiceManager;
class AppLoggerFactoryTest extends \Codeception\Test\Unit
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @var \UnitTester
*/
protected $tester;
public function testHandlers()
$serviceManager = new ServiceManager();
$serviceManager->setService('config', [
'logger' => [
'handlers' => [
new NoopHandler()
],
]);
$loggerFactory = new \SlayerBirden\DataFlowServer\Logger\AppLoggerFactory();
$logger = $loggerFactory($serviceManager);
$handlers = $logger->getHandlers();
$this->assertCount(1, $handlers);
}
public function testServiceHandlers()
NoopHandler::class
'dependencies' => [
'factories' => [
NoopHandler::class => InvokableFactory::class
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.