姿势:在几秒钟内在Laravel应用程序中创建基于类的模型工厂

时间:2024-03-11 18:58:39
【文件属性】:

文件名称:姿势:在几秒钟内在Laravel应用程序中创建基于类的模型工厂

文件大小:75KB

文件格式:ZIP

更新时间:2024-03-11 18:58:39

PHP

装腔作势者 Laravel基于类的模型工厂只需几秒钟! 编写看起来像这样的性感测试... /** @test */ public function a_user_can_have_customers () { UserFactory :: times ( 20 ) -> hasAddress () -> withCustomers ( CustomerFactory :: times ( 20 )-> withBooks ( 5 ))(); $ this -> assertCount ( 20 * 20 * 5 , Book :: all ()); } ...有一个看起来像这样的工厂... namespace Tests \ Factories ; use Lukeraymonddowning \ Pose


【文件预览】:
poser-master
----composer.json(1KB)
----phpunit.xml(847B)
----UPGRADE.md(2KB)
----composer.lock(184KB)
----tests()
--------Unit()
--------Models()
--------Factories()
--------DatabaseFactories()
--------TestCase.php(2KB)
----poser-logo.png(18KB)
----CONTRIBUTING.md(1KB)
----TODO.md(1KB)
----src()
--------Factory.php(23KB)
--------config()
--------TestCaseCaller.php(3KB)
--------Assertion.php(452B)
--------helpers.php(754B)
--------Exceptions()
--------CreatePoserFactory.php(6KB)
--------PoserServiceProvider.php(725B)
--------stubs()
--------Relationship.php(748B)
----.all-contributorsrc(3KB)
----LICENSE.md(1KB)
----.gitignore(52B)
----CHANGELOG.md(3KB)
----README.md(42KB)

网友评论