<commit_before><?php

namespace iansltx\BusinessDays\Test;

use iansltx\BusinessDays\StaticFilter;
use iansltx\BusinessDays\FilterFactory;

class FilterTest extends \PHPUnit_Framework_TestCase
{
    public function testWeekendTrue()
    {
        $this->assertTrue(StaticFilter::isWeekend(new \DateTime('next Sunday')));
    }

    public function testWeekendFalse()
    {
        $this->assertFalse(StaticFilter::isWeekend(new \DateTime('last Tuesday')));
    }

    public function testMonthDayNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::monthAndDay(1, '1');
    }

    public function testMonthDayInvalidMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(13, 1);
    }

    public function testMonthDayInvalidDay()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(12, 32);
    }

    public function testMonthDayInvalidDayForMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(2, 30);
    }

    public function testMonthDayFalse()
    {
        $isChristmas = FilterFactory::monthAndDay(12, 25);
        $this->assertFalse($isChristmas(new \DateTime('December 26')));
    }

    public function testMonthDayTrue()
    {
        $isChristmas = FilterFactory::monthAndDay(12, 25);
        $this->assertTrue($isChristmas(new \DateTime('December 25')));
    }

    public function testMonthDayDayOfWeekNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::monthAndDayOnDayOfWeek(1, 1, '0');
    }

    public function testMonthDayDayOfWeekInvalidMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(13, 1, 0);
    }

    public function testMonthDayDayOfWeekInvalidDay()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(12, 32, 0);
    }

    public function testMonthDayDayOfWeekInvalidDayForMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(2, 30, 0);
    }

    public function testMonthDayDayOfWeekInvalidDayOfWeek()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(2, 28, 7);
    }

    public function testMonthDayDayOfWeekWrongDayOfWeek()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('December 26 2015')));
    }

    public function testMonthDayDayOfWeekWrongMonth()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('September 26 2014')));
    }

    public function testMonthDayDayOfWeekWrongDay()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('December 25 2015')));
    }

    public function testMonthDayDayOfWeekTrue()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertTrue($isChristmas(new \DateTime('December 26 2014')));
    }

    public function testNthDayOfWeekOfMonthNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::nthDayOfWeekOfMonth(1, 0, '1');
    }

    public function testNthDayOfWeekOfMonthInvalidN()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::nthDayOfWeekOfMonth(6, 0, 1);
    }

    public function testNthDayOfWeekOfMonthInvalidDayOfWeek()
    {<commit_msg>Add edge case tests for month + day + day of week tests<commit_after><?php

namespace iansltx\BusinessDays\Test;

use iansltx\BusinessDays\StaticFilter;
use iansltx\BusinessDays\FilterFactory;

class FilterTest extends \PHPUnit_Framework_TestCase
{
    public function testWeekendTrue()
    {
        $this->assertTrue(StaticFilter::isWeekend(new \DateTime('next Sunday')));
    }

    public function testWeekendFalse()
    {
        $this->assertFalse(StaticFilter::isWeekend(new \DateTime('last Tuesday')));
    }

    public function testMonthDayNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::monthAndDay(1, '1');
    }

    public function testMonthDayInvalidMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(13, 1);
    }

    public function testMonthDayInvalidDay()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(12, 32);
    }

    public function testMonthDayInvalidDayForMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDay(2, 30);
    }

    public function testMonthDayFalse()
    {
        $isChristmas = FilterFactory::monthAndDay(12, 25);
        $this->assertFalse($isChristmas(new \DateTime('December 26')));
    }

    public function testMonthDayTrue()
    {
        $isChristmas = FilterFactory::monthAndDay(12, 25);
        $this->assertTrue($isChristmas(new \DateTime('December 25')));
    }

    public function testMonthDayDayOfWeekNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::monthAndDayOnDayOfWeek(1, 1, '0');
    }

    public function testMonthDayDayOfWeekInvalidMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(13, 1, 0);
    }

    public function testMonthDayDayOfWeekInvalidDay()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(12, 32, 0);
    }

    public function testMonthDayDayOfWeekInvalidDayForMonth()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(2, 30, 0);
    }

    public function testMonthDayDayOfWeekInvalidDayOfWeek()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::monthAndDayOnDayOfWeek(2, 28, 7);
    }

    public function testMonthDayDayOfWeekWrongDayOfWeek()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('December 26 2015')));
    }

    public function testMonthDayDayOfWeekWrongMonth()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('September 26 2014')));
    }

    public function testMonthDayDayOfWeekWrongDay()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertFalse($isChristmas(new \DateTime('December 25 2015')));
    }

    public function testMonthDayDayOfWeekTrue()
    {
        $isChristmas = FilterFactory::monthAndDayOnDayOfWeek(12, 26, 5);
        $this->assertTrue($isChristmas(new \DateTime('December 26 2014')));
    }

    public function testMonthDayDayOfWeekSunday()
    {
        $isSundayFebruary7th = FilterFactory::monthAndDayOnDayOfWeek(2, 7, 0);
        $this->assertTrue($isSundayFebruary7th(new \DateTime('February 7 2016')));
    }

    public function testMonthDayDayOfWeekSaturday()
    {
        $isSaturdayFebruary6th = FilterFactory::monthAndDayOnDayOfWeek(2, 6, 6);
        $this->assertTrue($isSaturdayFebruary6th(new \DateTime('February 6 2016')));
    }

    public function testNthDayOfWeekOfMonthNonInteger()
    {
        $this->expectException('\InvalidArgumentException');
        FilterFactory::nthDayOfWeekOfMonth(1, 0, '1');
    }

    public function testNthDayOfWeekOfMonthInvalidN()
    {
        $this->expectException('\OutOfBoundsException');
        FilterFactory::nthDayOfWeekOfMonth(6, 0, 1);
    }

    public function testNthDayOfWeekOfMonthInvalidDayOfWeek()
    {
{'fraction_non_alphanumeric': 0.117959080575903, 'fraction_numerical': 0.026269259914119727, 'mean_word_length': 3.6664702416028283, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '6397641', 'n_tokens_mistral': 2508, 'n_tokens_neox': 2286, 'n_words': 354}