start to add ability to merge tunes
started refactoring tune builders to use string type hint instead of StringAtom
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: richard
|
||||
* Date: 06/05/18
|
||||
* Time: 8:28 AM
|
||||
*/
|
||||
|
||||
use XaiCorp\AbcParser\Domain\Core\TuneAttributeArrayBuilder;
|
||||
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
|
||||
use XaiCorp\AbcParser\Domain\Core\Tune;
|
||||
|
||||
class TuneAttributeArrayBuilderTest extends \Codeception\Test\Unit
|
||||
{
|
||||
|
||||
public function testSetIndex()
|
||||
{
|
||||
$index = new UnsignedIntegerAtom('14');
|
||||
$builder = new TuneAttributeArrayBuilder();
|
||||
|
||||
$tune = $builder->setIndex($index)->getTune();
|
||||
|
||||
$this->assertInstanceOf(Tune::class, $tune);
|
||||
$this->assertEquals($index->getValue(), $tune->getIndex());
|
||||
}
|
||||
|
||||
public function testAppendMusic()
|
||||
{
|
||||
$music = new \Enzyme\Axiom\Atoms\StringAtom('Abcd|');
|
||||
$builder = new TuneAttributeArrayBuilder();
|
||||
|
||||
$tune = $builder->appendMusic($music)->getTune();
|
||||
|
||||
$this->assertInstanceOf(Tune::class, $tune);
|
||||
$this->assertEquals($music->getValue(), trim($tune->getMusic()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user