Skip to content

Commit 8c8cf3d

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: fixed wrong merge Tweak message to be Flex friendly [Routing] fixed tests Fixing wrong class_exists on interface Preserve percent-encoding in URLs when performing redirects in the UrlMatcher [Console] Fix a bug when passing a letter that could be an alias add missing validation options to XSD file Take advantage of AnnotationRegistry::registerUniqueLoader [DI] Optimize Container::get() for perf fix merge Fix tests Refactoring tests.
2 parents 8e67f1b + 98b6bc2 commit 8c8cf3d

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

Tests/CompoundFormTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ public function testArrayAccess()
308308

309309
$this->form[] = $child;
310310

311-
$this->assertTrue(isset($this->form['foo']));
311+
$this->assertArrayHasKey('foo', $this->form);
312312
$this->assertSame($child, $this->form['foo']);
313313

314314
unset($this->form['foo']);
315315

316-
$this->assertFalse(isset($this->form['foo']));
316+
$this->assertArrayNotHasKey('foo', $this->form);
317317
}
318318

319319
public function testCountable()

Tests/Extension/Core/Type/ChoiceTypeTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function testPlaceholderPresentOnNonRequiredExpandedSingleChoice()
196196
'choices' => $this->choices,
197197
));
198198

199-
$this->assertTrue(isset($form['placeholder']));
199+
$this->assertArrayHasKey('placeholder', $form);
200200
$this->assertCount(count($this->choices) + 1, $form, 'Each choice should become a new field');
201201
}
202202

@@ -209,7 +209,7 @@ public function testPlaceholderNotPresentIfRequired()
209209
'choices' => $this->choices,
210210
));
211211

212-
$this->assertFalse(isset($form['placeholder']));
212+
$this->assertArrayNotHasKey('placeholder', $form);
213213
$this->assertCount(count($this->choices), $form, 'Each choice should become a new field');
214214
}
215215

@@ -222,7 +222,7 @@ public function testPlaceholderNotPresentIfMultiple()
222222
'choices' => $this->choices,
223223
));
224224

225-
$this->assertFalse(isset($form['placeholder']));
225+
$this->assertArrayNotHasKey('placeholder', $form);
226226
$this->assertCount(count($this->choices), $form, 'Each choice should become a new field');
227227
}
228228

@@ -238,7 +238,7 @@ public function testPlaceholderNotPresentIfEmptyChoice()
238238
),
239239
));
240240

241-
$this->assertFalse(isset($form['placeholder']));
241+
$this->assertArrayNotHasKey('placeholder', $form);
242242
$this->assertCount(2, $form, 'Each choice should become a new field');
243243
}
244244

@@ -295,7 +295,7 @@ public function testPlaceholderWithExpandedBooleanChoices()
295295
'placeholder' => 'Select an option',
296296
));
297297

298-
$this->assertTrue(isset($form['placeholder']), 'Placeholder should be set');
298+
$this->assertArrayHasKey('placeholder', $form, 'Placeholder should be set');
299299
$this->assertCount(3, $form, 'Each choice should become a new field, placeholder included');
300300

301301
$view = $form->createView();
@@ -319,7 +319,7 @@ public function testPlaceholderWithExpandedBooleanChoicesAndWithFalseAsPreSetDat
319319
'placeholder' => 'Select an option',
320320
));
321321

322-
$this->assertTrue(isset($form['placeholder']), 'Placeholder should be set');
322+
$this->assertArrayHasKey('placeholder', $form, 'Placeholder should be set');
323323
$this->assertCount(3, $form, 'Each choice should become a new field, placeholder included');
324324

325325
$view = $form->createView();

Tests/Extension/Core/Type/CollectionTypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testSetDataAdjustsSize()
4949

5050
$form->setData(array('[email protected]'));
5151
$this->assertInstanceOf('Symfony\Component\Form\Form', $form[0]);
52-
$this->assertFalse(isset($form[1]));
52+
$this->assertArrayNotHasKey(1, $form);
5353
$this->assertCount(1, $form);
5454
$this->assertEquals('[email protected]', $form[0]->getData());
5555
$formAttrs0 = $form[0]->getConfig()->getOption('attr');
@@ -271,7 +271,7 @@ public function testGetDataDoesNotContainsPrototypeNameBeforeDataAreSet()
271271
));
272272

273273
$data = $form->getData();
274-
$this->assertFalse(isset($data['__name__']));
274+
$this->assertArrayNotHasKey('__name__', $data);
275275
}
276276

277277
public function testGetDataDoesNotContainsPrototypeNameAfterDataAreSet()
@@ -284,7 +284,7 @@ public function testGetDataDoesNotContainsPrototypeNameAfterDataAreSet()
284284

285285
$form->setData(array('foobar.png'));
286286
$data = $form->getData();
287-
$this->assertFalse(isset($data['__name__']));
287+
$this->assertArrayNotHasKey('__name__', $data);
288288
}
289289

290290
public function testPrototypeNameOption()

Tests/Extension/Core/Type/DateTimeTypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public function testDontPassHtml5TypeIfHtml5NotAllowed()
419419
))
420420
->createView();
421421

422-
$this->assertFalse(isset($view->vars['type']));
422+
$this->assertArrayNotHasKey('type', $view->vars);
423423
}
424424

425425
public function testDontPassHtml5TypeIfNotHtml5Format()
@@ -430,7 +430,7 @@ public function testDontPassHtml5TypeIfNotHtml5Format()
430430
))
431431
->createView();
432432

433-
$this->assertFalse(isset($view->vars['type']));
433+
$this->assertArrayNotHasKey('type', $view->vars);
434434
}
435435

436436
public function testDontPassHtml5TypeIfNotSingleText()
@@ -440,7 +440,7 @@ public function testDontPassHtml5TypeIfNotSingleText()
440440
))
441441
->createView();
442442

443-
$this->assertFalse(isset($view->vars['type']));
443+
$this->assertArrayNotHasKey('type', $view->vars);
444444
}
445445

446446
public function testDateTypeChoiceErrorsBubbleUp()

Tests/Extension/Core/Type/DateTypeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public function testDontPassDatePatternIfText()
678678
))
679679
->createView();
680680

681-
$this->assertFalse(isset($view->vars['date_pattern']));
681+
$this->assertArrayNotHasKey('date_pattern', $view->vars);
682682
}
683683

684684
public function testDatePatternFormatWithQuotedStrings()
@@ -826,7 +826,7 @@ public function testDontPassHtml5TypeIfHtml5NotAllowed()
826826
))
827827
->createView();
828828

829-
$this->assertFalse(isset($view->vars['type']));
829+
$this->assertArrayNotHasKey('type', $view->vars);
830830
}
831831

832832
public function testDontPassHtml5TypeIfNotHtml5Format()
@@ -837,7 +837,7 @@ public function testDontPassHtml5TypeIfNotHtml5Format()
837837
))
838838
->createView();
839839

840-
$this->assertFalse(isset($view->vars['type']));
840+
$this->assertArrayNotHasKey('type', $view->vars);
841841
}
842842

843843
public function testDontPassHtml5TypeIfNotSingleText()
@@ -847,7 +847,7 @@ public function testDontPassHtml5TypeIfNotSingleText()
847847
))
848848
->createView();
849849

850-
$this->assertFalse(isset($view->vars['type']));
850+
$this->assertArrayNotHasKey('type', $view->vars);
851851
}
852852

853853
public function provideCompoundWidgets()

Tests/Extension/Core/Type/TimeTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ public function testDontPassHtml5TypeIfHtml5NotAllowed()
536536
));
537537

538538
$view = $form->createView();
539-
$this->assertFalse(isset($view->vars['type']));
539+
$this->assertArrayNotHasKey('type', $view->vars);
540540
}
541541

542542
public function testPassDefaultPlaceholderToViewIfNotRequired()

Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testCsrfProtectionByDefaultIfRootAndCompound()
7272
))
7373
->createView();
7474

75-
$this->assertTrue(isset($view['csrf']));
75+
$this->assertArrayHasKey('csrf', $view);
7676
}
7777

7878
public function testNoCsrfProtectionByDefaultIfCompoundButNotRoot()
@@ -89,7 +89,7 @@ public function testNoCsrfProtectionByDefaultIfCompoundButNotRoot()
8989
->get('form')
9090
->createView();
9191

92-
$this->assertFalse(isset($view['csrf']));
92+
$this->assertArrayNotHasKey('csrf', $view);
9393
}
9494

9595
public function testNoCsrfProtectionByDefaultIfRootButNotCompound()
@@ -101,7 +101,7 @@ public function testNoCsrfProtectionByDefaultIfRootButNotCompound()
101101
))
102102
->createView();
103103

104-
$this->assertFalse(isset($view['csrf']));
104+
$this->assertArrayNotHasKey('csrf', $view);
105105
}
106106

107107
public function testCsrfProtectionCanBeDisabled()
@@ -114,7 +114,7 @@ public function testCsrfProtectionCanBeDisabled()
114114
))
115115
->createView();
116116

117-
$this->assertFalse(isset($view['csrf']));
117+
$this->assertArrayNotHasKey('csrf', $view);
118118
}
119119

120120
public function testGenerateCsrfToken()
@@ -357,7 +357,7 @@ public function testNoCsrfProtectionOnPrototype()
357357
->createView()
358358
->vars['prototype'];
359359

360-
$this->assertFalse(isset($prototypeView['csrf']));
360+
$this->assertArrayNotHasKey('csrf', $prototypeView);
361361
$this->assertCount(1, $prototypeView);
362362
}
363363

Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testCreatePath($string, $entries, $slicedPath = null)
9696
$path = new ViolationPath($string);
9797

9898
$this->assertSame($slicedPath, $path->__toString());
99-
$this->assertSame(count($entries), count($path->getElements()));
99+
$this->assertCount(count($entries), $path->getElements());
100100
$this->assertSame(count($entries), $path->getLength());
101101

102102
foreach ($entries as $index => $entry) {

Tests/Util/OrderedHashMapTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ public function testIsset()
9191
$map = new OrderedHashMap();
9292
$map['first'] = 1;
9393

94-
$this->assertTrue(isset($map['first']));
94+
$this->assertArrayHasKey('first', $map);
9595
}
9696

9797
public function testIssetReturnsFalseForNonExisting()
9898
{
9999
$map = new OrderedHashMap();
100100

101-
$this->assertFalse(isset($map['first']));
101+
$this->assertArrayNotHasKey('first', $map);
102102
}
103103

104104
public function testIssetReturnsFalseForNull()
105105
{
106106
$map = new OrderedHashMap();
107107
$map['first'] = null;
108108

109-
$this->assertFalse(isset($map['first']));
109+
$this->assertArrayNotHasKey('first', $map);
110110
}
111111

112112
public function testUnset()

0 commit comments

Comments
 (0)