<commit_before><?php

namespace Cercanias\Tests\Timetable;

use Cercanias\Station;
use Cercanias\Timetable;

class TimetableTest extends \PHPUnit_Framework_TestCase
{
    public function testGetDeparture()
    {
        $departure = new Station(1, "My station");
        $destination = new Station(2, "My destination");
        $timetable = new Timetable($departure, $destination);

        $this->assertEquals($departure, $timetable->getDeparture());
    }

    public function testGetDestination()
    {
        $departure = new Station(1, "My departure");
        $destination = new Station(2, "My destination");
        $timetable = new Timetable($departure, $destination);

        $this->assertEquals($destination, $timetable->getDestination());
    }

    public function testGetTrips()
    {
        $departure = new Station(1, "My departure");
        $destination = new Station(2, "My destination");
        $timetable = new Timetable($departure, $destination);
        $empty = new \ArrayIterator();

        $this->assertEquals($empty, $timetable->getTrips());
    }

}
<commit_msg>Refactor tests.<commit_after><?php

namespace Cercanias\Tests\Timetable;

use Cercanias\Station;
use Cercanias\Timetable;

class TimetableTest extends \PHPUnit_Framework_TestCase
{
    public function testGetDeparture()
    {
        $timetable = $this->createTimetable();

        $this->assertEquals($this->createDepartureStation(), $timetable->getDeparture());
    }

    public function testGetDestination()
    {
        $timetable = $this->createTimetable();

        $this->assertEquals($this->createDestinationStation(), $timetable->getDestination());
    }

    public function testGetTrips()
    {
        $timetable = $this->createTimetable();
        $empty = new \ArrayIterator();

        $this->assertEquals($empty, $timetable->getTrips());
    }

    protected function createTimetable()
    {
        return new Timetable(
            $this->createDepartureStation(),
            $this->createDestinationStation()
        );
    }

    protected function createDepartureStation()
    {
        return new Station(1, "My departure");
    }

    protected function createDestinationStation()
    {
        return new Station(2, "My destination");
    }
}

{'fraction_non_alphanumeric': 0.12676678445229683, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 3.1559633027522938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '117827', 'n_tokens_mistral': 667, 'n_tokens_neox': 636, 'n_words': 131}