Beispiel #1
0
 public function save(Event $event)
 {
     try {
         $this->filesystem->write($event->getUid() . ".json", json_encode($event));
     } catch (\Exception $e) {
         throw new RuntimeException($e->getMessage());
     }
 }
 /**
  * @test
  */
 public function it_tells_filesystem_to_write_json_version_of_event()
 {
     $event = new Event(["blah" => 1]);
     $this->filesystem->write($event->getUid() . ".json", json_encode($event))->shouldBeCalled();
     $this->SUT->save($event);
 }