Some checks failed
abc-api/abcParser/pipeline/head There was a failure building this commit
41 lines
1009 B
PHP
Executable File
41 lines
1009 B
PHP
Executable File
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: richard
|
|
* Date: 06/05/18
|
|
* Time: 8:28 AM
|
|
*/
|
|
|
|
use Codeception\Test\Unit;
|
|
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
|
|
use XaiCorp\AbcParser\Domain\Core\Tune;
|
|
use XaiCorp\AbcParser\Domain\Core\TuneAttributeArrayBuilder;
|
|
|
|
class TuneAttributeArrayBuilderTest extends 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 = 'Abcd|';
|
|
$builder = new TuneAttributeArrayBuilder();
|
|
|
|
$tune = $builder->appendMusic($music)->getTune();
|
|
|
|
$this->assertInstanceOf(Tune::class, $tune);
|
|
|
|
$settings = $tune->getSettings();
|
|
$this->assertEquals($music, trim($settings[0]->getMusic()));
|
|
}
|
|
}
|