<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Eelke
 * Date: 13-8-14
 * Time: 17:45
 */

require_once __DIR__ . '/mocks/MockSignable.php';

class SignableTest extends PHPUnit_Framework_TestCase {

    public function setUp()
    {
        $this->instance = new MockSignable();
    }

    public function testSettersAndGetters()
    {
        $this->instance->setSignature($signature = new \Autograph\Signature('my_key', new DateTimeImmutable(), '1.0'));
        $this->assertEquals($this->instance->getSignature(), $signature);
    }

    public function testSigning()
    {
        $this->instance->sign(new \Autograph\Token('my_key', 'my_secret'));

        //test if a signature was set
        $this->assertInstanceOf('Autograph\\Signature',$signature = $this->instance->getSignature());

        //test if the signature contains a hash
        $this->assertNotNull($signature->hash);
    }
<commit_msg>remove immutable datetime class<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Eelke
 * Date: 13-8-14
 * Time: 17:45
 */

require_once __DIR__ . '/mocks/MockSignable.php';

class SignableTest extends PHPUnit_Framework_TestCase {

    public function setUp()
    {
        $this->instance = new MockSignable();
    }

    public function testSettersAndGetters()
    {
        $this->instance->setSignature($signature = new \Autograph\Signature('my_key', time(), '1.0'));
        $this->assertEquals($this->instance->getSignature(), $signature);
    }

    public function testSigning()
    {
        $this->instance->sign(new \Autograph\Token('my_key', 'my_secret'));

        //test if a signature was set
        $this->assertInstanceOf('Autograph\\Signature',$signature = $this->instance->getSignature());

        //test if the signature contains a hash
        $this->assertNotNull($signature->hash);
    }

{'fraction_non_alphanumeric': 0.14790647090810222, 'fraction_numerical': 0.011963023382272975, 'mean_word_length': 3.1913439635535306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '4188667', 'n_tokens_mistral': 556, 'n_tokens_neox': 535, 'n_words': 114}