for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche/Model component.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Domain\Model\Tests\Units;
use Cubiche\Domain\Model\Tests\Fixtures\Post;
use Cubiche\Domain\Model\Tests\Fixtures\PostId;
* AggregateRootTests class.
* Generated by TestGenerator on 2016-05-03 at 16:01:26.
class AggregateRootTests extends TestCase
{
* Test id method.
public function testId()
$this
->given($id = PostId::fromNative($this->faker->ean13()))
->and($aggregateRoot = new Post($id, $this->faker->sentence(), $this->faker->paragraph()))
->then()
->boolean($aggregateRoot->id()->equals($id))
->isTrue()
;
}
* Test equals method.
public function testEquals()
->given(
$aggregateRoot1 = new Post(
PostId::fromNative($this->faker->unique()->uuid()),
$this->faker->sentence(),
$this->faker->paragraph()
)
->and(
$aggregateRoot2 = new Post(
PostId::fromNative($this->faker->ean13()),
->boolean($aggregateRoot1->equals($aggregateRoot1))
->boolean($aggregateRoot1->equals($aggregateRoot2))
->isFalse()