function it_can_be_attached_to_a_category() { $stream = new Stream(); $stream->addEvent(new TransactionWasCreated(Uuid::uuid4(), '20150730', 'This is a shorter description that is really long', '1234567890', '0987654321', "GT", "30,00", "This is a description")); $stream->addEvent(new TransactionWasAttachedToCategory(Uuid::uuid4())); $stream->addEvent(new TransactionWasAttachedToCategory(Uuid::uuid4())); $this->replay($stream)->shouldHaveType(Transaction::class); $this->getCategories()->shouldHaveCount(2); }
function it_can_be_created_from_stream() { $stream = new Stream(); $stream->addEvent(new CategoryWasCreated(Uuid::uuid4(), "Groceries", "Food")); $this->replay($stream)->shouldHaveType(Category::class); }