function it_finds_a_saved_blog(Blog $blog, BlogId $blogId) { $blogId->__toString()->willReturn('***'); $blog->getId()->willReturn($blogId); $this->save($blog); $this->find($blogId)->shouldBe($blog); }
function it_converts_object_keys_to_string(Collection $internal, BlogId $key) { $this->beConstructedWith(BlogId::class, 'string', $internal); $key->__toString()->willReturn('key_value'); $internal->set('key_value', 'test')->shouldBeCalled(); $internal->offsetGet('key_value')->willReturn(null); $internal->contains('test')->willReturn(false); $this->set($key, 'test'); }