Skip to content

Commit

Permalink
Add Informacao namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mrprompt committed Dec 22, 2020
1 parent 6506ca0 commit 99386c9
Show file tree
Hide file tree
Showing 16 changed files with 464 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Informacao/Anuncio.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace ImovelWeb\Informacao;

use ImovelWeb\Base\Base;

final class Anuncio extends Base
{
/**
* As especificações de um atributo de um campo do anúncio.
*
* @param int $campoPai
* @param int $campoFilho
* @return mixed
*/
public function subCampo(int $campoPai, int $campoFilho)
{
return $this->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}}");
}
}
30 changes: 30 additions & 0 deletions src/Informacao/Lancamento.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace ImovelWeb\Informacao;

use ImovelWeb\Base\Base;

final class Lancamento extends Base
{
/**
* As especificações de um atributo de um campo do lançamento.
*
* @param int $campoPai
* @param int $campoFilho
* @return mixed
*/
public function subCampo(int $campoPai, int $campoFilho)
{
return $this->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}}");
}
}
30 changes: 30 additions & 0 deletions src/Informacao/Multimidia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace ImovelWeb\Informacao;

use ImovelWeb\Base\Base;

final class Multimidia extends Base
{
/**
* As especificações de um atributo de um campo de multimídia.
*
* @param int $campoPai
* @param int $campoFilho
* @return mixed
*/
public function subCampo(int $campoPai, int $campoFilho)
{
return $this->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}}");
}
}
30 changes: 30 additions & 0 deletions src/Informacao/Unidade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace ImovelWeb\Informacao;

use ImovelWeb\Base\Base;

final class Unidade extends Base
{
/**
* As especificações de um atributo de um campo da unidade do lançamento.
*
* @param int $campoPai
* @param int $campoFilho
* @return mixed
*/
public function subCampo(int $campoPai, int $campoFilho)
{
return $this->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}}");
}
}
62 changes: 62 additions & 0 deletions tests/Informacao/AnuncioTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
namespace ImovelWeb\Tests\Informacao;

use GuzzleHttp\Psr7\Response;
use ImovelWeb\Informacao\Anuncio;
use ImovelWeb\Tests\Base\Base;

final class AnuncioTest extends Base
{
/**
* @test
*/
public function anuncioSubCampo()
{
$handleResponse = $this->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);
}
}
62 changes: 62 additions & 0 deletions tests/Informacao/LancamentoTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
namespace ImovelWeb\Tests\Informacao;

use GuzzleHttp\Psr7\Response;
use ImovelWeb\Informacao\Lancamento;
use ImovelWeb\Tests\Base\Base;

final class LancamentoTest extends Base
{
/**
* @test
*/
public function lancamentoSubCampo()
{
$handleResponse = $this->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);
}
}
62 changes: 62 additions & 0 deletions tests/Informacao/MultimidiaTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
namespace ImovelWeb\Tests\Informacao;

use GuzzleHttp\Psr7\Response;
use ImovelWeb\Informacao\Multimidia;
use ImovelWeb\Tests\Base\Base;

final class MultimidiaTest extends Base
{
/**
* @test
*/
public function multimidiaSubCampo()
{
$handleResponse = $this->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);
}
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/anuncioCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/anuncioSubCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/lancamentoCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/lancamentoSubCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/multimidiaCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
12 changes: 12 additions & 0 deletions tests/Informacao/Responses/multimidiaSubCampo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"descripcion": "string",
"ejemplo": "string",
"esObligatorio": "string",
"especificacion": "string",
"maximo": "string",
"minimo": "string",
"nombre": "string",
"posiblesValores": "string",
"recomendaciones": "string",
"tipo": "string"
}
Loading

0 comments on commit 99386c9

Please sign in to comment.