diff --git a/src/Informacao/Anuncio.php b/src/Informacao/Anuncio.php new file mode 100644 index 0000000..4a26718 --- /dev/null +++ b/src/Informacao/Anuncio.php @@ -0,0 +1,30 @@ +request('GET', "informacao/anuncio/{$campoPai}/{$campoFilho}"); + } + + /** + * As especificações de um campo do anúncio. + * + * @param int $campo + * @return mixed + */ + public function campo(int $campo) + { + return $this->request('GET', "informacao/anuncio/{$campo}}"); + } +} diff --git a/src/Informacao/Lancamento.php b/src/Informacao/Lancamento.php new file mode 100644 index 0000000..f79adf2 --- /dev/null +++ b/src/Informacao/Lancamento.php @@ -0,0 +1,30 @@ +request('GET', "informacao/lancamento/{$campoPai}/{$campoFilho}"); + } + + /** + * As especificações de um atributo do lançamento. + * + * @param int $campo + * @return mixed + */ + public function campo(int $campo) + { + return $this->request('GET', "informacao/lancamento/{$campo}}"); + } +} diff --git a/src/Informacao/Multimidia.php b/src/Informacao/Multimidia.php new file mode 100644 index 0000000..7d6cd87 --- /dev/null +++ b/src/Informacao/Multimidia.php @@ -0,0 +1,30 @@ +request('GET', "informacao/multimidia/{$campoPai}/{$campoFilho}"); + } + + /** + * As especificações de um atributo do multimidia. + * + * @param int $campo + * @return mixed + */ + public function campo(int $campo) + { + return $this->request('GET', "informacao/multimidia/{$campo}}"); + } +} diff --git a/src/Informacao/Unidade.php b/src/Informacao/Unidade.php new file mode 100644 index 0000000..646f9a5 --- /dev/null +++ b/src/Informacao/Unidade.php @@ -0,0 +1,30 @@ +request('GET', "informacao/unidade/{$campoPai}/{$campoFilho}"); + } + + /** + * As especificações de um atributo da unidade do lançamento. + * + * @param int $campo + * @return mixed + */ + public function campo(int $campo) + { + return $this->request('GET', "informacao/unidade/{$campo}}"); + } +} diff --git a/tests/Informacao/AnuncioTest.php b/tests/Informacao/AnuncioTest.php new file mode 100644 index 0000000..eca378a --- /dev/null +++ b/tests/Informacao/AnuncioTest.php @@ -0,0 +1,62 @@ +fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Anuncio($this->client); + + $result = $this->service->subCampo( + $this->faker->randomNumber(4), + $this->faker->randomNumber(4) + ); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } + + /** + * @test + */ + public function anuncioCampo() + { + $handleResponse = $this->fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Anuncio($this->client); + + $result = $this->service->campo($this->faker->randomNumber(4)); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } +} diff --git a/tests/Informacao/LancamentoTest.php b/tests/Informacao/LancamentoTest.php new file mode 100644 index 0000000..f8bd7c8 --- /dev/null +++ b/tests/Informacao/LancamentoTest.php @@ -0,0 +1,62 @@ +fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Lancamento($this->client); + + $result = $this->service->subCampo( + $this->faker->randomNumber(4), + $this->faker->randomNumber(4) + ); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } + + /** + * @test + */ + public function lancamentoCampo() + { + $handleResponse = $this->fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Lancamento($this->client); + + $result = $this->service->campo($this->faker->randomNumber(4)); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } +} diff --git a/tests/Informacao/MultimidiaTest.php b/tests/Informacao/MultimidiaTest.php new file mode 100644 index 0000000..35edfae --- /dev/null +++ b/tests/Informacao/MultimidiaTest.php @@ -0,0 +1,62 @@ +fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Multimidia($this->client); + + $result = $this->service->subCampo( + $this->faker->randomNumber(4), + $this->faker->randomNumber(4) + ); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } + + /** + * @test + */ + public function multimidiaCampo() + { + $handleResponse = $this->fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Multimidia($this->client); + + $result = $this->service->campo($this->faker->randomNumber(4)); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } +} diff --git a/tests/Informacao/Responses/anuncioCampo.json b/tests/Informacao/Responses/anuncioCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/anuncioCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/anuncioSubCampo.json b/tests/Informacao/Responses/anuncioSubCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/anuncioSubCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/lancamentoCampo.json b/tests/Informacao/Responses/lancamentoCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/lancamentoCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/lancamentoSubCampo.json b/tests/Informacao/Responses/lancamentoSubCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/lancamentoSubCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/multimidiaCampo.json b/tests/Informacao/Responses/multimidiaCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/multimidiaCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/multimidiaSubCampo.json b/tests/Informacao/Responses/multimidiaSubCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/multimidiaSubCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/unidadeCampo.json b/tests/Informacao/Responses/unidadeCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/unidadeCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/Responses/unidadeSubCampo.json b/tests/Informacao/Responses/unidadeSubCampo.json new file mode 100644 index 0000000..1329ee4 --- /dev/null +++ b/tests/Informacao/Responses/unidadeSubCampo.json @@ -0,0 +1,12 @@ +{ + "descripcion": "string", + "ejemplo": "string", + "esObligatorio": "string", + "especificacion": "string", + "maximo": "string", + "minimo": "string", + "nombre": "string", + "posiblesValores": "string", + "recomendaciones": "string", + "tipo": "string" +} \ No newline at end of file diff --git a/tests/Informacao/UnidadeTest.php b/tests/Informacao/UnidadeTest.php new file mode 100644 index 0000000..bcb7332 --- /dev/null +++ b/tests/Informacao/UnidadeTest.php @@ -0,0 +1,62 @@ +fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Unidade($this->client); + + $result = $this->service->subCampo( + $this->faker->randomNumber(4), + $this->faker->randomNumber(4) + ); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } + + /** + * @test + */ + public function unidadeCampo() + { + $handleResponse = $this->fixture(__FUNCTION__, 'Responses'); + $handlerStack = [new Response(200, [], $handleResponse)]; + + $this->client = $this->getClient($handlerStack); + $this->service = new Unidade($this->client); + + $result = $this->service->campo($this->faker->randomNumber(4)); + + $this->assertArrayHasKey('descripcion', $result); + $this->assertArrayHasKey('ejemplo', $result); + $this->assertArrayHasKey('esObligatorio', $result); + $this->assertArrayHasKey('especificacion', $result); + $this->assertArrayHasKey('maximo', $result); + $this->assertArrayHasKey('minimo', $result); + $this->assertArrayHasKey('nombre', $result); + $this->assertArrayHasKey('posiblesValores', $result); + $this->assertArrayHasKey('recomendaciones', $result); + $this->assertArrayHasKey('tipo', $result); + } +}