-
Notifications
You must be signed in to change notification settings - Fork 36
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
25 changed files
with
1,259 additions
and
1 deletion.
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,3 @@ | ||
bin | ||
vendor | ||
composer.lock |
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,11 @@ | ||
language: php | ||
phpp: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
|
||
before_script: | ||
- composer install --dev -v --prefer-source | ||
|
||
script: | ||
- bin/phpspec run -fpretty --verbose |
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
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
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,29 @@ | ||
{ | ||
"name": "welp/mailchimp-bundle", | ||
"description": "MailChimp API V3 Symfony Bundle", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Titouan BENOIT", | ||
"email": "titouan@welp.today" | ||
}, | ||
{ | ||
"name": "Gabriel Pillet", | ||
"email": "contact@gabrielpillet.com" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Welp\\MailchimpBundle\\": "src/" | ||
} | ||
}, | ||
"require": { | ||
"mailchimp/mailchimp": "^2.0", | ||
"phpspec/phpspec": "~2@dev", | ||
"psr/log": "^1.0", | ||
"symfony/options-resolver": "~2@dev|~3@dev" | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
} | ||
} |
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,4 @@ | ||
suites: | ||
default: | ||
namespace: Welp\MailchimpBundle | ||
psr4_prefix: Welp\MailchimpBundle |
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,31 @@ | ||
<?php | ||
|
||
namespace spec\Welp\MailchimpBundle\Event; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
use Welp\MailchimpBundle\Subscriber\Subscriber; | ||
|
||
class SubscriberEventSpec extends ObjectBehavior | ||
{ | ||
function let(Subscriber $subscriber) | ||
{ | ||
$this->beConstructedWith('listname', $subscriber); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType('Welp\MailchimpBundle\Event\SubscriberEvent'); | ||
$this->shouldHaveType('Symfony\Component\EventDispatcher\Event'); | ||
} | ||
|
||
function it_has_a_listname() | ||
{ | ||
$this->getListName()->shouldReturn('listname'); | ||
} | ||
|
||
function it_has_a_subscriber($subscriber) | ||
{ | ||
$this->getSubscriber()->shouldReturn($subscriber); | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
namespace spec\Welp\MailchimpBundle\Event; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
use Welp\MailchimpBundle\Subscriber\Subscriber; | ||
use Welp\MailchimpBundle\Subscriber\ListRepository; | ||
use Welp\MailchimpBundle\Event\SubscriberEvent; | ||
|
||
class SubscriberListenerSpec extends ObjectBehavior | ||
{ | ||
function let(ListRepository $listRepository, SubscriberEvent $event, Subscriber $subscriber) | ||
{ | ||
$listRepository->findByName('foo')->willReturn(['id' => 123]); | ||
|
||
$event->getListName()->willReturn('foo'); | ||
$event->getSubscriber()->willReturn($subscriber); | ||
|
||
$this->beConstructedWith($listRepository); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType('Welp\MailchimpBundle\Event\SubscriberListener'); | ||
} | ||
|
||
function it_listen_to_subscribe_events($listRepository, $event, $subscriber) | ||
{ | ||
$listRepository->subscribe(123, $subscriber)->shouldBeCalled(); | ||
$this->onSubscribe($event); | ||
} | ||
|
||
function it_listen_to_unsubscribe_events($listRepository, $event, $subscriber) | ||
{ | ||
$listRepository->unsubscribe(123, $subscriber)->shouldBeCalled(); | ||
$this->onUnsubscribe($event); | ||
} | ||
} |
Oops, something went wrong.