v2.3.0
Features
0867ad6 feat: add #[WithStory]
attribute (#728) by @nikophil
You can use the #[WithStory]
attribute to load stories in your tests:
use App\Story\CategoryStory;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Zenstruck\Foundry\Attribute\WithStory;
// You can use the attribute on the class...
#[WithStory(CategoryStory::class)]
final class NeedsCategoriesTest extends KernelTestCase
{
// ... or on the method
#[WithStory(CategoryStory::class)]
public function testThatNeedStories(): void
{
// ...
}
}
If used on the class, the story will be loaded before each test method.
Fixes
af64c35 fix: detect if relation is oneToOne (#732) by @nikophil
c8f5046 fix: fix PHPUnit constraint requirement in FoundryExtension (#735) by @HypeMC
403d9e9 fix: Fix the parameter name of the first and last methods (#730) by @marien-probesys
c5d0bdd fix: can create inversed one to one with non nullable (#726) by @nikophil
f48ffd1 fix: can create inversed one to one (#659) by @nikophil
6d08784 fix: bug with one to many (#722) by @nikophil
Minor
b16b227 docs: Update index.rst (#740) by @OskarStark, @nikophil
854220f docs: fix highlighting and use CPP (#740) by @OskarStark
dfe6bab tests: add paratest permutation (#736) by @nikophil
59867c3 tests: change versions requirements (#737) by @nikophil
4cb7447 docs: Typo in Immutable section (#731) by @franckranaivo
0e7ac6f docs: Fix Story phpdocs (#727) by @simondaigre, @nikophil
efadea8 docs:fix code blocks not showing up (#723) by @AndreasA
edf287e minor: Add templated types to flush_after (#719) by @BackEndTea