Skip to content

Commit ea93f1b

Browse files
Merge branch '4.4' into 5.1
* 4.4: add mising sr (latn & cyrl) translations [Cache] fix ProxyAdapter not persisting items with infinite expiration [HttpClient] fail properly when the server replies with HTTP/0.9 Fix CS [Cache] Limit cache version character range [DI] dump OS-indepent paths in the compiled container allow consumers to mock all methods
2 parents 8b12c8e + f5ad6b0 commit ea93f1b

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed

Resources/translations/validators.sr_Cyrl.xlf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,26 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Ова вредност треба да буде између {{ min }} и {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Ова вредност није исправно име послужитеља (hostname).</target>
372+
</trans-unit>
373+
<trans-unit id="96">
374+
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
375+
<target>Број елемената у овој колекцији би требало да буде дељив са {{ compared_value }}.</target>
376+
</trans-unit>
377+
<trans-unit id="97">
378+
<source>This value should satisfy at least one of the following constraints:</source>
379+
<target>Ова вредност би требало да задовољава најмање једно од наредних ограничења:</target>
380+
</trans-unit>
381+
<trans-unit id="98">
382+
<source>Each element of this collection should satisfy its own set of constraints.</source>
383+
<target>Сваки елемент ове колекције би требало да задовољи сопствени скуп ограничења.</target>
384+
</trans-unit>
385+
<trans-unit id="99">
386+
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
387+
<target>Ова вредност није исправна међународна идентификациона ознака хартија од вредности (ISIN).</target>
388+
</trans-unit>
369389
</body>
370390
</file>
371391
</xliff>

Resources/translations/validators.sr_Latn.xlf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,26 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Ova vrednost treba da bude između {{ min }} i {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Ova vrednost nije ispravno ime poslužitelja (hostname).</target>
372+
</trans-unit>
373+
<trans-unit id="96">
374+
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
375+
<target>Broj elemenata u ovoj kolekciji bi trebalo da bude deljiv sa {{ compared_value }}.</target>
376+
</trans-unit>
377+
<trans-unit id="97">
378+
<source>This value should satisfy at least one of the following constraints:</source>
379+
<target>Ova vrednost bi trebalo da zadovoljava namjanje jedno od narednih ograničenja:</target>
380+
</trans-unit>
381+
<trans-unit id="98">
382+
<source>Each element of this collection should satisfy its own set of constraints.</source>
383+
<target>Svaki element ove kolekcije bi trebalo da zadovolji sopstveni skup ograničenja.</target>
384+
</trans-unit>
385+
<trans-unit id="99">
386+
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
387+
<target>Ova vrednost nije ispravna međunarodna identifikaciona oznaka hartija od vrednosti (ISIN).</target>
388+
</trans-unit>
369389
</body>
370390
</file>
371391
</xliff>

Test/ConstraintValidatorTestCase.php

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,45 @@ protected function createContext()
113113
$context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath);
114114
$context->setConstraint($this->constraint);
115115

116+
$contextualValidator = $this->getMockBuilder(AssertingContextualValidator::class)
117+
->setConstructorArgs([$context])
118+
->setMethods([
119+
'atPath',
120+
'validate',
121+
'validateProperty',
122+
'validatePropertyValue',
123+
'getViolations',
124+
])
125+
->getMock();
126+
$contextualValidator->expects($this->any())
127+
->method('atPath')
128+
->willReturnCallback(function ($path) use ($contextualValidator) {
129+
return $contextualValidator->doAtPath($path);
130+
});
131+
$contextualValidator->expects($this->any())
132+
->method('validate')
133+
->willReturnCallback(function ($value, $constraints = null, $groups = null) use ($contextualValidator) {
134+
return $contextualValidator->doValidate($value, $constraints, $groups);
135+
});
136+
$contextualValidator->expects($this->any())
137+
->method('validateProperty')
138+
->willReturnCallback(function ($object, $propertyName, $groups = null) use ($contextualValidator) {
139+
return $contextualValidator->validateProperty($object, $propertyName, $groups);
140+
});
141+
$contextualValidator->expects($this->any())
142+
->method('validatePropertyValue')
143+
->willReturnCallback(function ($objectOrClass, $propertyName, $value, $groups = null) use ($contextualValidator) {
144+
return $contextualValidator->doValidatePropertyValue($objectOrClass, $propertyName, $value, $groups);
145+
});
146+
$contextualValidator->expects($this->any())
147+
->method('getViolations')
148+
->willReturnCallback(function () use ($contextualValidator) {
149+
return $contextualValidator->doGetViolations();
150+
});
116151
$validator->expects($this->any())
117152
->method('inContext')
118153
->with($context)
119-
->willReturn($this->getMockBuilder(AssertingContextualValidator::class)->setConstructorArgs([$context])->setMethods(null)->getMock());
154+
->willReturn($contextualValidator);
120155

121156
return $context;
122157
}
@@ -403,6 +438,10 @@ public function __construct(ExecutionContextInterface $context)
403438
}
404439

405440
public function atPath($path)
441+
{
442+
}
443+
444+
public function doAtPath($path)
406445
{
407446
Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.');
408447

@@ -416,6 +455,10 @@ public function atPath($path)
416455
}
417456

418457
public function validate($value, $constraints = null, $groups = null)
458+
{
459+
}
460+
461+
public function doValidate($value, $constraints = null, $groups = null)
419462
{
420463
Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.');
421464

@@ -437,11 +480,19 @@ public function validate($value, $constraints = null, $groups = null)
437480
}
438481

439482
public function validateProperty($object, $propertyName, $groups = null)
483+
{
484+
}
485+
486+
public function doValidateProperty($object, $propertyName, $groups = null)
440487
{
441488
return $this;
442489
}
443490

444491
public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null)
492+
{
493+
}
494+
495+
public function doValidatePropertyValue($objectOrClass, $propertyName, $value, $groups = null)
445496
{
446497
return $this;
447498
}
@@ -451,6 +502,10 @@ public function getViolations()
451502
return $this->context->getViolations();
452503
}
453504

505+
public function doGetViolations()
506+
{
507+
}
508+
454509
public function expectNoValidate()
455510
{
456511
$this->expectNoValidate = true;

0 commit comments

Comments
 (0)