<commit_before><?php

namespace Tests\AppBundle\Model;


use AppBundle\Model\StressPeriod;

class StressPeriodTest extends \PHPUnit_Framework_TestCase
{

    public function testInstantiateWithDefaultValues()
    {
        $stressPeriod = new StressPeriod();
        $this->assertInstanceOf('AppBundle\Model\StressPeriod', $stressPeriod);
        $this->assertEquals(null, $stressPeriod->getDateTimeBegin());
        $this->assertEquals(null, $stressPeriod->getDateTimeEnd());
        $this->assertEquals(1, $stressPeriod->getNumberOfTimeSteps());
        $this->assertEquals(true, $stressPeriod->isSteady());
    }

    public function testInstantiateWithValues()
    {
        $dateBegin = new \DateTime();
        $dateEnd = new \DateTime();
        $numberOfTimeSteps = 2;
        $steady = false;

        $stressPeriod = new StressPeriod($dateBegin, $dateEnd, $numberOfTimeSteps, $steady);
        $this->assertInstanceOf('AppBundle\Model\StressPeriod', $stressPeriod);
        $this->assertEquals($dateBegin, $stressPeriod->getDateTimeBegin());
        $this->assertEquals($dateEnd, $stressPeriod->getDateTimeEnd());
        $this->assertEquals($numberOfTimeSteps, $stressPeriod->getNumberOfTimeSteps());
        $this->assertEquals($steady, $stressPeriod->isSteady());
    }

    public function testSetGetDateBegin()
    {
        $dateBegin = new \DateTime();
        $stressPeriod = new StressPeriod();
        $stressPeriod->setDateTimeBegin($dateBegin);
        $this->assertEquals($dateBegin, $stressPeriod->getDateTimeBegin());
    }

    public function testSetGetDateEnd()
    {
        $dateEnd = new \DateTime();
        $stressPeriod = new StressPeriod();
        $stressPeriod->setDateTimeBegin($dateEnd);
        $this->assertEquals($dateEnd, $stressPeriod->getDateTimeBegin());
    }

    public function testSetGetNumberOfTimeSteps()
    {
        $numberOfTimeSteps = 2;
        $stressPeriod = new StressPeriod();
        $stressPeriod->setNumberOfTimeSteps($numberOfTimeSteps);
        $this->assertEquals($numberOfTimeSteps, $stressPeriod->getNumberOfTimeSteps());
    }

    public function testSetGetSteady()
    {
        $steady = false;
        $stressPeriod = new StressPeriod();
        $stressPeriod->setSteady($steady);
        $this->assertEquals($steady, $stressPeriod->isSteady());
    }

    public function testSerialize(){
        $dateBegin = new \DateTime('2015-01-01', new \DateTimeZone('Europe/Berlin'));
        $dateEnd = new \DateTime('2015-01-02', new \DateTimeZone('Europe/Berlin'));
        $numberOfTimeSteps = 2;
        $steady = false;

        $stressPeriod = new StressPeriod($dateBegin, $dateEnd, $numberOfTimeSteps, $steady);
        $expected = json_decode('{"dateTimeBegin":{"date":"2015-01-01 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Berlin"},"dateTimeEnd":{"date":"2015-01-02 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Berlin"},"numberOfTimeSteps":2,"steady":false}');
        $this->assertEquals($expected, json_decode(json_encode($stressPeriod)));
    }
}
<commit_msg>Update StressPeriodTest<commit_after><?php

namespace Tests\AppBundle\Model;


use AppBundle\Model\StressPeriod;

class StressPeriodTest extends \PHPUnit_Framework_TestCase
{

    public function testInstantiateWithDefaultValues()
    {
        $stressPeriod = new StressPeriod();
        $this->assertInstanceOf('AppBundle\Model\StressPeriod', $stressPeriod);
        $this->assertEquals(null, $stressPeriod->getDateTimeBegin());
        $this->assertEquals(null, $stressPeriod->getDateTimeEnd());
        $this->assertEquals(1, $stressPeriod->getNumberOfTimeSteps());
        $this->assertEquals(true, $stressPeriod->isSteady());
    }

    public function testInstantiateWithValues()
    {
        $dateBegin = new \DateTime();
        $dateEnd = new \DateTime();
        $numberOfTimeSteps = 2;
        $steady = false;

        $stressPeriod = new StressPeriod($dateBegin, $dateEnd, $numberOfTimeSteps, $steady);
        $this->assertInstanceOf('AppBundle\Model\StressPeriod', $stressPeriod);
        $this->assertEquals($dateBegin, $stressPeriod->getDateTimeBegin());
        $this->assertEquals($dateEnd, $stressPeriod->getDateTimeEnd());
        $this->assertEquals($numberOfTimeSteps, $stressPeriod->getNumberOfTimeSteps());
        $this->assertEquals($steady, $stressPeriod->isSteady());
    }

    public function testSetGetDateBegin()
    {
        $dateBegin = new \DateTime();
        $stressPeriod = new StressPeriod();
        $stressPeriod->setDateTimeBegin($dateBegin);
        $this->assertEquals($dateBegin, $stressPeriod->getDateTimeBegin());
    }

    public function testSetGetDateEnd()
    {
        $dateEnd = new \DateTime();
        $stressPeriod = new StressPeriod();
        $stressPeriod->setDateTimeEnd($dateEnd);
        $this->assertEquals($dateEnd, $stressPeriod->getDateTimeEnd());
    }

    public function testSetGetNumberOfTimeSteps()
    {
        $numberOfTimeSteps = 2;
        $stressPeriod = new StressPeriod();
        $stressPeriod->setNumberOfTimeSteps($numberOfTimeSteps);
        $this->assertEquals($numberOfTimeSteps, $stressPeriod->getNumberOfTimeSteps());
    }

    public function testSetGetSteady()
    {
        $steady = false;
        $stressPeriod = new StressPeriod();
        $stressPeriod->setSteady($steady);
        $this->assertEquals($steady, $stressPeriod->isSteady());
    }

    public function testSerialize(){
        $dateBegin = new \DateTime('2015-01-01', new \DateTimeZone('Europe/Berlin'));
        $dateEnd = new \DateTime('2015-01-02', new \DateTimeZone('Europe/Berlin'));
        $numberOfTimeSteps = 2;
        $steady = false;

        $stressPeriod = new StressPeriod($dateBegin, $dateEnd, $numberOfTimeSteps, $steady);
        $expected = json_decode('{"dateTimeBegin":{"date":"2015-01-01 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Berlin"},"dateTimeEnd":{"date":"2015-01-02 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Berlin"},"numberOfTimeSteps":2,"steady":false}');
        $this->assertEquals($expected, json_decode(json_encode($stressPeriod)));
    }
}

{'fraction_non_alphanumeric': 0.14882506527415143, 'fraction_numerical': 0.020561357702349868, 'mean_word_length': 3.833596214511041, 'pattern_counts': {'":': 20, '<': 5, '<?xml version=': 0, '>': 65, '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': '5205877', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1727, 'n_words': 259}