Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This library extends PHPUnit with asserting from Monolog logging entries.

License

phoenixrvd/phpunit-assert-log-entry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

PHPUnit assert log entry

Minimum PHP Version Latest Stable Version composer.lock License

Build Status Code Climate StyleCI Test Coverage Latest Unstable Version

This library extends PHPUnit with asserting from Monolog logging entries.

Installation

Install the latest version with

composer require phoenixrvd/phpunit-assert-log-entry

Example

<?php
use PHPUnit\Framework\TestCase;
class LogAssertionsTest extends TestCase
{
 use \PhoenixRVD\PHPUnitLogAssertions\LogAssertions;
 
 public function testFoo(){
 // Get a Monolog instance
 $logger = new \Monolog\Logger(__CLASS__);
 // Register a logger in test case handler
 self::attachLogger($logger);
 $logger->debug('foo');
 self::assertLogHasDebugRecords();
 self::assertLogHasDebug('foo');
 }
 
}

Testing

composer phpunit_log_assertions:test

Copyright and license

Code released under the MIT License.

About

This library extends PHPUnit with asserting from Monolog logging entries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /