Skip to content

Commit

Permalink
[Validator] removed usage of deprecated getMessageParameters() and ge…
Browse files Browse the repository at this point in the history
…tMessagePluralization() in unit tests
  • Loading branch information
fabpot committed Jan 9, 2015
1 parent c6f1f69 commit 818ca58
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
Expand Up @@ -155,12 +155,12 @@ public function testValidateInSeparateContext()
$test->assertCount(1, $violations);
$test->assertSame('Message value', $violations[0]->getMessage());
$test->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$test->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$test->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$test->assertSame('', $violations[0]->getPropertyPath());
// The root is different as we're in a new context
$test->assertSame($entity->reference, $violations[0]->getRoot());
$test->assertSame($entity->reference, $violations[0]->getInvalidValue());
$test->assertNull($violations[0]->getMessagePluralization());
$test->assertNull($violations[0]->getPlural());
$test->assertNull($violations[0]->getCode());

// Verify that this method is called
Expand Down Expand Up @@ -252,11 +252,11 @@ public function testValidateInContext()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('subpath', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
$this->assertNull($violations[0]->getMessagePluralization());
$this->assertNull($violations[0]->getPlural());
$this->assertNull($violations[0]->getCode());
}

Expand Down Expand Up @@ -316,11 +316,11 @@ public function testValidateArrayInContext()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('subpath[key]', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
$this->assertNull($violations[0]->getMessagePluralization());
$this->assertNull($violations[0]->getPlural());
$this->assertNull($violations[0]->getCode());
}

Expand Down Expand Up @@ -355,11 +355,11 @@ public function testTraverseTraversableByDefault()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('[key]', $violations[0]->getPropertyPath());
$this->assertSame($traversable, $violations[0]->getRoot());
$this->assertSame($entity, $violations[0]->getInvalidValue());
$this->assertNull($violations[0]->getMessagePluralization());
$this->assertNull($violations[0]->getPlural());
$this->assertNull($violations[0]->getCode());
}

Expand Down Expand Up @@ -527,11 +527,11 @@ public function testAddCustomizedViolation()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
$this->assertSame(2, $violations[0]->getMessagePluralization());
$this->assertSame(2, $violations[0]->getPlural());
$this->assertSame(42, $violations[0]->getCode());
}

Expand Down
Expand Up @@ -166,11 +166,11 @@ public function testValidateInContext()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('subpath', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
$this->assertNull($violations[0]->getMessagePluralization());
$this->assertNull($violations[0]->getPlural());
$this->assertNull($violations[0]->getCode());
}

Expand Down Expand Up @@ -224,11 +224,11 @@ public function testValidateArrayInContext()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('subpath[key]', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
$this->assertNull($violations[0]->getMessagePluralization());
$this->assertNull($violations[0]->getPlural());
$this->assertNull($violations[0]->getCode());
}

Expand All @@ -254,11 +254,11 @@ public function testAddCustomizedViolation()
$this->assertCount(1, $violations);
$this->assertSame('Message value', $violations[0]->getMessage());
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
$this->assertSame('', $violations[0]->getPropertyPath());
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
$this->assertSame(2, $violations[0]->getMessagePluralization());
$this->assertSame(2, $violations[0]->getPlural());
$this->assertSame('Code', $violations[0]->getCode());
}

Expand Down

0 comments on commit 818ca58

Please sign in to comment.