Skip to content

Commit

Permalink
StyleCI rules applied
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsx committed Dec 16, 2015
1 parent 3eaa38b commit 79ec7ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Model/Test/TestEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class TestEntity extends IndexedModel implements LocalizableModelInterface

public static function getValidationRules($entityId = null, array $requestEntity = [])
{
$hash = !empty($requestEntity['hash']) ? $requestEntity['hash'] : '';
$hash = ! empty($requestEntity['hash']) ? $requestEntity['hash'] : '';

return [
'entity_id' => 'required|uuid',
Expand All @@ -75,7 +75,7 @@ public static function getValidationRules($entityId = null, array $requestEntity
'multi_word_column_title' => 'required|boolean',
'hidden' => 'required|boolean',
'json' => 'required|decoded_json',
'non_existant' => 'required_if:conditional,yes|in:' . $hash,
'non_existant' => 'required_if:conditional,yes|in:'.$hash,
];
}

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public function testPutOneNewInvalidId()
}

/**
* Conditional validation expects "non_existant" field to be equal to hash value
* Conditional validation expects "non_existant" field to be equal to hash value.
*/
public function testConditionalValidationUsingRequestValue()
{
Expand All @@ -503,12 +503,12 @@ public function testConditionalValidationUsingRequestValue()
->customize(['conditional' => 'yes', 'non_existant' => 'bad value'])
->transformed();

$this->withAuthorization()->putJson('/test/entities/' . $entity['entityId'], $entity);
$this->withAuthorization()->putJson('/test/entities/'.$entity['entityId'], $entity);
$this->assertResponseStatus(422);

$entity['nonExistant'] = $entity['hash'];

$this->withAuthorization()->putJson('/test/entities/' . $entity['entityId'], $entity);
$this->withAuthorization()->putJson('/test/entities/'.$entity['entityId'], $entity);
$this->assertResponseStatus(201);
}

Expand Down

0 comments on commit 79ec7ae

Please sign in to comment.