<commit_before><?php

namespace _20TRIES\Test;

use _20TRIES\DateRange;
use Carbon\Carbon;

/**
 * Class GettersTest.
 *
 * @author <NAME> <<EMAIL>>
 *
 * @since v0
 */
class GettersTest extends \PHPUnit_Framework_TestCase
{
    public function test_getFrom_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            $after = Carbon::today()->subSecond(),
            Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today(), $range->getFrom());

        $this->assertTrue($after !== $range->getFrom());
    }

    public function test_getTo_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            Carbon::today()->subSecond(),
            $before = Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today()->endOfDay(), $range->getTo());

        $this->assertTrue($before !== $range->getTo());
    }
}<commit_msg>Added tests for "getAfter" and "getBefore" methods to makes sure that the object date instances are not returned and that the datetime values are returned correctly.<commit_after><?php

namespace _20TRIES\Test;

use _20TRIES\DateRange;
use Carbon\Carbon;

/**
 * Class GettersTest.
 *
 * @author <NAME> <<EMAIL>>
 *
 * @since v0
 */
class GettersTest extends \PHPUnit_Framework_TestCase
{
    public function test_getAfter_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            $after = Carbon::today()->subSecond(),
            Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today()->subSecond(), $range->getAfter());

        $this->assertTrue($after !== $range->getAfter());
    }

    public function test_getFrom_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            $after = Carbon::today()->subSecond(),
            Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today(), $range->getFrom());

        $this->assertTrue($after !== $range->getFrom());
    }

    public function test_getBefore_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            Carbon::today()->subSecond(),
            $before = Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today()->endOfDay()->addSecond(), $range->getBefore());

        $this->assertTrue($before !== $range->getBefore());
    }

    public function test_getTo_returns_a_new_carbon_instance_with_correct_value()
    {
        $range = new DateRange(
            Carbon::today()->subSecond(),
            $before = Carbon::today()->endOfDay()->addSecond()
        );

        $this->assertEquals(Carbon::today()->endOfDay(), $range->getTo());

        $this->assertTrue($before !== $range->getTo());
    }
}
{'fraction_non_alphanumeric': 0.16177992411176267, 'fraction_numerical': 0.0034494653328734047, 'mean_word_length': 3.1666666666666665, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 56, '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': '2811032', 'n_tokens_mistral': 888, 'n_tokens_neox': 842, 'n_words': 139}