コード例 #1
0
ファイル: RastreamentoSpec.php プロジェクト: Corcioli/Frete
 function it_can_track_with_one_object(Client $client, RastreamentoResult $result)
 {
     $response = new FakeRastreamentoResponse('object');
     $data = ['Usuario' => '', 'Senha' => '', 'Tipo' => 'L', 'Resultado' => 'U', 'Objetos' => ''];
     $client->post(Data::URL_RASTREAMENTO, ['body' => $data])->willReturn($response);
     # result
     $result->fill(Argument::any())->shouldBeCalled();
     $this->track()->shouldBeAnInstanceOf('EscapeWork\\Frete\\Correios\\RastreamentoResult');
 }
コード例 #2
0
ファイル: Rastreamento.php プロジェクト: escapework/frete
 protected function makeCollection($data)
 {
     $objects = new Collection();
     foreach ($data->objeto as $objeto) {
         $result = new RastreamentoResult();
         $result->fill($objeto);
         $objects[] = $result;
     }
     return $objects;
 }