Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 08bfb87

Browse files
committed
Backported assertIsX and assertIsNotX methods for PHPUnit 6.5
1 parent b902981 commit 08bfb87

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

Diff for: src/TestCase.php

+110
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,114 @@ public static function assertStringNotContainsStringIgnoringCase($needle, $hayst
8181
}
8282
\Codeception\PHPUnit\TestCase::assertNotContains($needle, $haystack, $message, true);
8383
}
84+
85+
public static function assertIsArray($actual, $message = '')
86+
{
87+
\Codeception\PHPUnit\TestCase::assertInternalType('array', $actual, $message);
88+
}
89+
90+
public static function assertIsBool($actual, $message = '')
91+
{
92+
\Codeception\PHPUnit\TestCase::assertInternalType('bool', $actual, $message);
93+
}
94+
95+
public static function assertIsFloat($actual, $message = '')
96+
{
97+
\Codeception\PHPUnit\TestCase::assertInternalType('float', $actual, $message);
98+
}
99+
100+
public static function assertIsInt($actual, $message = '')
101+
{
102+
\Codeception\PHPUnit\TestCase::assertInternalType('int', $actual, $message);
103+
}
104+
105+
public static function assertIsNumeric($actual, $message = '')
106+
{
107+
\Codeception\PHPUnit\TestCase::assertInternalType('numeric', $actual, $message);
108+
}
109+
110+
public static function assertIsObject($actual, $message = '')
111+
{
112+
\Codeception\PHPUnit\TestCase::assertInternalType('object', $actual, $message);
113+
}
114+
115+
public static function assertIsResource($actual, $message = '')
116+
{
117+
\Codeception\PHPUnit\TestCase::assertInternalType('resource', $actual, $message);
118+
}
119+
120+
public static function assertIsString($actual, $message = '')
121+
{
122+
\Codeception\PHPUnit\TestCase::assertInternalType('string', $actual, $message);
123+
}
124+
125+
public static function assertIsScalar($actual, $message = '')
126+
{
127+
\Codeception\PHPUnit\TestCase::assertInternalType('scalar', $actual, $message);
128+
}
129+
130+
public static function assertIsCallable($actual, $message = '')
131+
{
132+
\Codeception\PHPUnit\TestCase::assertInternalType('callable', $actual, $message);
133+
}
134+
135+
public static function assertIsIterable($actual, $message = '')
136+
{
137+
\Codeception\PHPUnit\TestCase::assertInternalType('iterable', $actual, $message);
138+
}
139+
140+
public static function assertIsNotArray($actual, $message = '')
141+
{
142+
\Codeception\PHPUnit\TestCase::assertNotInternalType('array', $actual, $message);
143+
}
144+
145+
public static function assertIsNotBool($actual, $message = '')
146+
{
147+
\Codeception\PHPUnit\TestCase::assertNotInternalType('bool', $actual, $message);
148+
}
149+
150+
public static function assertIsNotFloat($actual, $message = '')
151+
{
152+
\Codeception\PHPUnit\TestCase::assertNotInternalType('float', $actual, $message);
153+
}
154+
155+
public static function assertIsNotInt($actual, $message = '')
156+
{
157+
\Codeception\PHPUnit\TestCase::assertNotInternalType('int', $actual, $message);
158+
}
159+
160+
public static function assertIsNotNumeric($actual, $message = '')
161+
{
162+
\Codeception\PHPUnit\TestCase::assertNotInternalType('numeric', $actual, $message);
163+
}
164+
165+
public static function assertIsNotObject($actual, $message = '')
166+
{
167+
\Codeception\PHPUnit\TestCase::assertNotInternalType('object', $actual, $message);
168+
}
169+
170+
public static function assertIsNotResource($actual, $message = '')
171+
{
172+
\Codeception\PHPUnit\TestCase::assertNotInternalType('resource', $actual, $message);
173+
}
174+
175+
public static function assertIsNotString($actual, $message = '')
176+
{
177+
\Codeception\PHPUnit\TestCase::assertNotInternalType('string', $actual, $message);
178+
}
179+
180+
public static function assertIsNotScalar($actual, $message = '')
181+
{
182+
\Codeception\PHPUnit\TestCase::assertNotInternalType('scalar', $actual, $message);
183+
}
184+
185+
public static function assertIsNotCallable($actual, $message = '')
186+
{
187+
\Codeception\PHPUnit\TestCase::assertNotInternalType('callable', $actual, $message);
188+
}
189+
190+
public static function assertIsNotIterable($actual, $message = '')
191+
{
192+
\Codeception\PHPUnit\TestCase::assertNotInternalType('iterable', $actual, $message);
193+
}
84194
}

0 commit comments

Comments
 (0)