The YAML Dataset has no factory method on the Database TestCase currently, so you have to instantiate it manually:
<?php
use PHPUnit\Framework\TestCase;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
class YamlGuestbookTest extends TestCase
{
use TestCaseTrait;
protected function getDataSet()
{
return new YamlDataSet(dirname(__FILE__)."/_files/guestbook.yml");
}
}
?>
The `YamlDataSet` is the only `IDataSet` implementation provided by DbUnit that does not have a a factory method. This PR creates a protected factory method for `YamlDataSet` on `TestCaseTrait` to be consistent with the rest of the `IDataSet` implementations. The availability of such a factory method also allows callers to remain compatible with DbUnit if a future release changes the namespace or name of the `YamlDataSet` class.
The DbUnit documentation currently states:
class YamlGuestbookTest extends TestCase { use TestCaseTrait;
} ?>