/** * @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')); }
/** * @param Contract $contract * * @return Interfaces\SerializesData */ private function getSerializerForContract(Contract $contract) { return $this->serializationStrategy->getSerializerForContract($contract); }