コード例 #1
0
 /**
  * @expectedException \hollodotme\MilestonES\Exceptions\SerializationContractIsNotRegistered
  */
 public function testGetSerializerForContractFailsWhenContractIsNotRegistered()
 {
     $php_contract = new Contract(PhpSerializer::class);
     $this->registry->registerSerializerForContract($php_contract, new PhpSerializer());
     $strategy = new SerializationStrategy($this->registry, $php_contract);
     $strategy->getSerializerForContract(new Contract('Some\\Not\\Registered\\Contract'));
 }
コード例 #2
0
 /**
  * @param Contract $contract
  *
  * @return Interfaces\SerializesData
  */
 private function getSerializerForContract(Contract $contract)
 {
     return $this->serializationStrategy->getSerializerForContract($contract);
 }