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
5 changed files
with
118 additions
and
22 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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
bootstrap="vendor/autoload.php" | ||
> | ||
<testsuite name="Prooph Event-Sourcing Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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,85 @@ | ||
<?php | ||
/* | ||
* This file is part of the prooph/event-store. | ||
* (c) Alexander Miertsch <contact@prooph.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* Date: 18.04.14 - 00:04 | ||
*/ | ||
|
||
namespace Prooph\EventSourcingTest\Mock; | ||
|
||
use Prooph\EventSourcing\AggregateChanged; | ||
use Prooph\EventSourcing\AggregateRoot; | ||
use Rhumsaa\Uuid\Uuid; | ||
|
||
/** | ||
* Class BrokenUser | ||
* | ||
* @package Prooph\EventStoreTest\Mock | ||
* @author Alexander Miertsch <contact@prooph.de> | ||
*/ | ||
class BrokenUser extends AggregateRoot | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
public static function nameNew($name) | ||
{ | ||
$id = Uuid::uuid4()->toString(); | ||
$instance = new self(); | ||
|
||
$instance->recordThat(UserCreated::occur($id, ['id' => $id, 'name' => $name])); | ||
|
||
return $instance; | ||
} | ||
|
||
/** | ||
* @param AggregateChanged[] $historyEvents | ||
* @return User | ||
*/ | ||
public static function fromHistory(array $historyEvents) | ||
{ | ||
return self::reconstituteFromHistory($historyEvents); | ||
} | ||
/** | ||
* @return string | ||
*/ | ||
public function id() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function name() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @return \Prooph\EventSourcing\AggregateChanged[] | ||
*/ | ||
public function accessRecordedEvents() | ||
{ | ||
return $this->popRecordedEvents(); | ||
} | ||
|
||
/** | ||
* @return string representation of the unique identifier of the aggregate root | ||
*/ | ||
protected function aggregateId() | ||
{ | ||
return $this->id(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.