The Clean Architecture in php


use CleanPhp\Invoicer\Domain\Model\Invoice; use



Download 2,26 Mb.
Pdf ko'rish
bet141/179
Sana24.06.2021
Hajmi2,26 Mb.
#100337
1   ...   137   138   139   140   141   142   143   144   ...   179
Bog'liq
The-Clean-Architecture-in-PHP-Kristopher-Wilson

use
CleanPhp\Invoicer\Domain\Model\Invoice;
use
CleanPhp\Invoicer\Domain\Model\Order;
use
CleanPhp\Invoicer\Domain\Factory\InvoiceFactory;
describe(
'InvoiceFactory'
,
function
() {
describe(
'->createFromOrder()'
,
function
() {
it(
'should return an order object'
,
function
() {
$order
=
new
Order();
$factory
=
new
InvoiceFactory();
$invoice
=
$factory
->
createFromOrder
(
$order
);
expect(
$invoice
)
->
to
->
be
->
instanceof
(
'CleanPhp\Invoicer\Domain\Entity\Invoice'
);
});
});
});
This simple test just makes sure that our
InvoiceFactory
is returning an instance of an
Invoice
object.
If we run Peridot again, our test will be failing. So let’s go ahead and write the basic
InvoiceFactory
class and make this test pass!
We’ll start with the basic structure of the
InvoiceFactory
:


Building Our Domain
110
// src/Domain/Factory/InvoiceFactory.php
namespace
CleanPhp\Invoicer\Domain\Factory;
use
CleanPhp\Invoicer\Domain\Entity\Invoice;

Download 2,26 Mb.

Do'stlaringiz bilan baham:
1   ...   137   138   139   140   141   142   143   144   ...   179




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish