Files
abcParser/tests/unit/AbcParser/Domain/Core/TuneAttributeArrayBuilderTest.php
richard 2cdf7dd1cf
Some checks failed
abc-api/abcParser/pipeline/head There was a failure building this commit
update webpatser/laravel-uuid to version 3
2020-06-20 12:36:34 -04:00

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()));
}
}