This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Factory | |
{ | |
/** | |
* @var array | |
*/ | |
private $contexts = []; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Bundle\DoctrineBundle\Registry; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Doctrine\DBAL\Connection; | |
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | |
class FixtureTestCase extends KernelTestCase | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PayoutContext | |
{ | |
/** | |
* @var PayoutId | |
*/ | |
public $payoutId; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PaymentContext | |
{ | |
/** | |
* @var PaymentId | |
*/ | |
public $paymentId; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$payout = Factory::create() | |
->withPayment(function (PaymentContext $payment) { | |
$payment->amount = new Money(1337, new Currency('USD')); | |
}) | |
->payout(function (PayoutContext $payout) { | |
$payout->payoutId = PayoutId::fromString('03f74472-0e31-4d5c-8f61-bf34bda2dcb2'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$payout = Factory::create()->payout(function (PayoutContext $payout) { | |
$payout->payoutId = PayoutId::fromString('03f74472-0e31-4d5c-8f61-bf34bda2dcb2'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ExampleTest extends FixtureTestCase | |
{ | |
/** | |
* @test | |
*/ | |
public function testSomething() : void | |
{ | |
$payout = $this->fixture()->payout(function (PayoutContext $payout) { |
OlderNewer