/** * UtilityTest::testInArray() * * @covers ::inArray * @return void */ public function testInArray() { $res = Utility::inArray(2, [1, 2, 3]); $this->assertTrue($res); $res = Utility::inArray(4, [1, 2, 7]); $this->assertFalse($res); $res = Utility::inArray('2', [1, 2, 3]); $this->assertTrue($res); $res = Utility::inArray(2, ['1x', '2x', '3x']); $this->assertFalse($res); $res = Utility::inArray('3x', ['1x', '2x', '3x']); $this->assertTrue($res); $res = Utility::inArray(3, ['1', '2', '3']); $this->assertTrue($res); $res = Utility::inArray('2x', [1, 2, 3]); $this->assertFalse($res); }