File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
tests/Type/WebMozartAssert/data Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ This extension specifies types of values passed to:
5757* ` Assert::notFalse `
5858* ` Assert::null `
5959* ` Assert::notNull `
60+ * ` Assert::isEmpty `
61+ * ` Assert::notEmpty `
6062* ` Assert::eq `
6163* ` Assert::notEq `
6264* ` Assert::same `
Original file line number Diff line number Diff line change @@ -44,6 +44,32 @@ public function notNull(?int $a): void
4444 assertType ('int ' , $ a );
4545 }
4646
47+ /** @param string|null $c */
48+ public function isEmpty (string $ a , $ b , $ c ): void
49+ {
50+ Assert::isEmpty ($ a );
51+ assertType ("''|'0' " , $ a );
52+
53+ Assert::isEmpty ($ b );
54+ assertType ("0|0.0|''|'0'|array{}|false|null " , $ b );
55+
56+ Assert::isEmpty ($ c );
57+ assertType ("''|'0'|null " , $ c );
58+ }
59+
60+ /** @param string|null $c */
61+ public function notEmpty (string $ a , $ b , $ c ): void
62+ {
63+ Assert::notEmpty ($ a );
64+ assertType ('non-falsy-string ' , $ a );
65+
66+ Assert::notEmpty ($ b );
67+ assertType ("mixed~0|0.0|''|'0'|array{}|false|null " , $ b );
68+
69+ Assert::notEmpty ($ c );
70+ assertType ('non-falsy-string ' , $ c );
71+ }
72+
4773 /**
4874 * @param non-empty-string $b2
4975 */
You can’t perform that action at this time.
0 commit comments