<commit_before><?php

namespace Busayo\Yearly\Test;

class YearAfterYearTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test that true does in fact equal true
     */
    public function testTrueIsTrue()
    {
        $this->assertTrue(true);
    }
}<commit_msg>Add Unit tests<commit_after><?php

namespace Busayo\Yearly\Test;

use Busayo\Yearly\YearAfterYear as Yearly;

class YearAfterYearTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Hold instance of Yearly
     * @var object
     */
    protected $yearly;

    /**
     * Get the Current Year
     * @return integer
     */
    private function getCurrentYear()
    {
        return date("Y");
    }

    /**
     * Create an instance of Yearly
     * @return void
     */
    private function instantiateYearly()
    {
        $this->yearly = new Yearly();
    }

    /**
     *  Create an instance of Yearly before running each tests
     */
    public function setUp(){
        $this->instantiateYearly();
    }

    /**
     * Test that it returns the current year
     * @return boolean
     */
    public function testCurrentYear()
    {
        $this->assertEquals($this->getCurrentYear(), $this->yearly->current_year());
    }

    /**
     * Test that it returns a range of years when a particular year is passed in as an argument
     * @return boolean
     */
    public function testRangeOfYearsWhenProvidedAStartYear()
    {
        $startYear = 2002;

        $this->assertEquals("{$startYear} - {$this->getCurrentYear()}", $this->yearly->year_range($startYear));
    }

    /**
     * Test that it returns the current year if the start year equals current year
     * @return boolean
     */
    public function testReturnValueWhenStartYearEqualsCurrentYear()
    {
        $startYear = $this->getCurrentYear();

        $this->assertEquals($this->getCurrentYear(), $this->yearly->year_range($startYear));
    }
}
{'fraction_non_alphanumeric': 0.11385099685204617, 'fraction_numerical': 0.002098635886673662, 'mean_word_length': 2.4926739926739927, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '4199206', 'n_tokens_mistral': 550, 'n_tokens_neox': 540, 'n_words': 142}