finished default parser

This commit is contained in:
2018-04-24 07:19:17 -04:00
parent ff99a0eaaf
commit 8a1c752045
26 changed files with 1757 additions and 6 deletions

View File

@@ -0,0 +1,50 @@
<?php
/**
* Created by PhpStorm.
* User: richard
* Date: 11/25/17
* Time: 5:06 PM
*/
namespace Tests\Unit\AbcParser\Domain\Atoms;
use Enzyme\Axiom\Atoms\AtomInterface;
use Enzyme\Axiom\Exceptions\AtomException;
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
class UnsignedIntegerAtomTest extends \PHPUnit_Framework_TestCase
{
public function testCreateAtom()
{
$value = 1;
$result = new UnsignedIntegerAtom($value);
$this->assertInstanceOf(AtomInterface::class, $result);
$this->assertEquals($value, $result->getValue());
}
/**
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
*/
public function testCreateAtom0Fails()
{
$value = 0;
$result = new UnsignedIntegerAtom($value);
$this->assertEquals(false, $result, 'should have failed to create');
}
/**
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
*/
public function testCreateNegativeAtomFails()
{
$value = -1;
$result = new UnsignedIntegerAtom($value);
$this->assertEquals(false, $result, 'should have failed to create');
}
}