Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Webgriffe\SyliusActiveCampaignPlugin\Factory\ActiveCampaign; | ||
|
||
use Webgriffe\SyliusActiveCampaignPlugin\Factory\ActiveCampaign\ContactTagFactory; | ||
use PhpSpec\ObjectBehavior; | ||
use Webgriffe\SyliusActiveCampaignPlugin\Factory\ActiveCampaign\ContactTagFactoryInterface; | ||
use Webgriffe\SyliusActiveCampaignPlugin\Model\ActiveCampaign\ContactTag; | ||
|
||
class ContactTagFactorySpec extends ObjectBehavior | ||
{ | ||
public function let(): void | ||
{ | ||
$this->beConstructedWith(); | ||
} | ||
|
||
public function it_is_initializable(): void | ||
{ | ||
$this->shouldBeAnInstanceOf(ContactTagFactory::class); | ||
} | ||
|
||
public function it_implements_contact_tag_factory_interface(): void | ||
{ | ||
$this->shouldImplement(ContactTagFactoryInterface::class); | ||
} | ||
|
||
public function it_should_returns_a_contact_tag_instance(): void | ||
{ | ||
$this->createNew(2, 3)->shouldReturnAnInstanceOf(ContactTag::class); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Webgriffe\SyliusActiveCampaignPlugin\Factory\ActiveCampaign; | ||
|
||
use Webgriffe\SyliusActiveCampaignPlugin\Model\ActiveCampaign\ContactTag; | ||
use Webgriffe\SyliusActiveCampaignPlugin\Model\ActiveCampaign\ContactTagInterface; | ||
|
||
final class ContactTagFactory implements ContactTagFactoryInterface | ||
{ | ||
public function createNew(int $contactId, int $tagId): ContactTagInterface | ||
{ | ||
return new ContactTag($contactId, $tagId); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Webgriffe\SyliusActiveCampaignPlugin\Factory\ActiveCampaign; | ||
|
||
use Webgriffe\SyliusActiveCampaignPlugin\Model\ActiveCampaign\ContactTagInterface; | ||
|
||
interface ContactTagFactoryInterface | ||
{ | ||
public function createNew(int $contactId, int $tagId): ContactTagInterface; | ||
} |
This file contains 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