mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 23:17:47 +01:00
test: add ArrayBag tests
This commit is contained in:
@@ -12,12 +12,12 @@ use Flasher\Prime\Notification\Envelope;
|
||||
interface BagInterface
|
||||
{
|
||||
/**
|
||||
* @return array<string, Envelope>
|
||||
* @return Envelope[]
|
||||
*/
|
||||
public function get();
|
||||
|
||||
/**
|
||||
* @param array<string, Envelope> $envelopes
|
||||
* @param Envelope[] $envelopes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Tests\Prime\Storage\Bag;
|
||||
|
||||
use Flasher\Prime\Notification\Envelope;
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
use Flasher\Prime\Storage\Bag\ArrayBag;
|
||||
use Flasher\Tests\Prime\TestCase;
|
||||
|
||||
class ArrayBagTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testArrayBag()
|
||||
{
|
||||
$bag = new ArrayBag();
|
||||
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification()),
|
||||
new Envelope(new Notification()),
|
||||
);
|
||||
|
||||
$bag->set($envelopes);
|
||||
|
||||
$this->assertEquals($envelopes, $bag->get());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user