<commit_before><?php
namespace Graze\Monolog\Handler;

use Mockery as m;
use Monolog\TestCase;

class WhoopsHandlerTest extends TestCase
{
    public function setUp()
    {
        if (!class_exists('Whoops\Handler\HandlerInterface', false)) {
            //$this->markTestSkipped('filp/whoops not installed');
        }
        
        $this->handlerWhoops = m::mock('Whoops\Handler\HandlerInterface');
    }

    public function testConstruct()
    {
        $this->assertInstanceOf('Graze\\Monolog\\Handler\\WhoopsHandler', new WhoopsHandler($this->handlerWhoops));
    }

    public function testInterface()
    {
        $this->assertInstanceOf('Monolog\\Handler\\HandlerInterface', new WhoopsHandler($this->handlerWhoops));
    }

    public function testHandleError()
    {
        $record = $this->getRecord(300, 'test', array('file' => 'bar', 'line' => 1));
        
        $formatter = m::mock('Monolog\\Formatter\\FormatterInterface');
        
        $handlerMonolog = new WhoopsHandler($this->handlerWhoops);
             
        $this->handlerWhoops
            ->shouldReceive('setInspector')
            ->once()
            ->with(m::type('Whoops\Exception\Inspector'));
              
        $this->handlerWhoops<commit_msg>Check whether class exists before testing whoops handler<commit_after><?php
namespace Graze\Monolog\Handler;

use Mockery as m;
use Monolog\TestCase;

class WhoopsHandlerTest extends TestCase
{
    public function setUp()
    {
        if (!interface_exists('Whoops\Handler\HandlerInterface', true)) {
            $this->markTestSkipped('filp/whoops not installed');
        }
        
        $this->handlerWhoops = m::mock('Whoops\Handler\HandlerInterface');
    }

    public function testConstruct()
    {
        $this->assertInstanceOf('Graze\\Monolog\\Handler\\WhoopsHandler', new WhoopsHandler($this->handlerWhoops));
    }

    public function testInterface()
    {
        $this->assertInstanceOf('Monolog\\Handler\\HandlerInterface', new WhoopsHandler($this->handlerWhoops));
    }

    public function testHandleError()
    {
        $record = $this->getRecord(300, 'test', array('file' => 'bar', 'line' => 1));
        
        $formatter = m::mock('Monolog\\Formatter\\FormatterInterface');
        
        $handlerMonolog = new WhoopsHandler($this->handlerWhoops);
             
        $this->handlerWhoops
            ->shouldReceive('setInspector')
            ->once()
            ->with(m::type('Whoops\Exception\Inspector'));
              
        $this->handlerWhoops
{'fraction_non_alphanumeric': 0.13790386130811663, 'fraction_numerical': 0.0031520882584712374, 'mean_word_length': 2.6690751445086707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4937599', 'n_tokens_mistral': 708, 'n_tokens_neox': 693, 'n_words': 118}