2323use DarkWebDesign \SymfonyAddonConstraints \Collection ;
2424use PHPUnit \Framework \TestCase ;
2525use Symfony \Component \Validator \Constraints as Assert ;
26+ use Symfony \Component \Validator \Exception \ConstraintDefinitionException ;
27+ use Symfony \Component \Validator \Exception \MissingOptionsException ;
2628
2729class CollectionTest extends TestCase
2830{
@@ -33,54 +35,55 @@ public function testConstruct()
3335 new Assert \NotBlank (),
3436 ],
3537 ]);
38+
39+ $ this ->assertTrue (true );
3640 }
3741
3842 public function testConstructDefaultOption ()
3943 {
4044 new Collection ([
4145 new Assert \NotBlank (),
4246 ]);
47+
48+ $ this ->assertTrue (true );
4349 }
4450
45- /**
46- * @expectedException \Symfony\Component\Validator\Exception\MissingOptionsException
47- */
4851 public function testConstructMissingRequiredConstraintsOption ()
4952 {
53+ $ this ->expectException (MissingOptionsException::class);
54+
5055 new Collection ();
5156 }
5257
5358 /**
5459 * @param mixed $constraints
5560 *
5661 * @dataProvider providerNoArray
57- *
58- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
5962 */
6063 public function testConstructConstraintsOptionNoArray ($ constraints )
6164 {
65+ $ this ->expectException (ConstraintDefinitionException::class);
66+
6267 new Collection ([
6368 'constraints ' => $ constraints ,
6469 ]);
6570 }
6671
67- /**
68- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
69- */
7072 public function testConstructNoConstraint ()
7173 {
74+ $ this ->expectException (ConstraintDefinitionException::class);
75+
7276 new Collection ([
7377 'constraints ' => [
7478 'foo ' ,
7579 ],
7680 ]);
7781 }
7882
79- /**
80- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
81- */
8283 public function testConstructValidConstraint ()
8384 {
85+ $ this ->expectException (ConstraintDefinitionException::class);
86+
8487 new Collection ([
8588 'constraints ' => [
8689 new Assert \Valid (),
0 commit comments