/** * Checks if the provided octal permissions is a valid value * @param int $octalPermissions Octal permissions * @return null * @throws zibo\ZiboException when the provided permissions is not a valid octal permissions value */ private function checkOctalPermissions($octalPermissions) { $lengthPermissions = strlen($octalPermissions); if ($lengthPermissions > 5) { throw new ZiboException('Provided permissions is not a valid octal permissions value: too much digits'); } if (!Number::isOctal($octalPermissions)) { throw new ZiboException('Provided permissions is not a valid octal permissions value: not an octal value'); } }
/** * @dataProvider providerIsOctalThrowsExceptionWhenNoNumericValueIsPassed * @expectedException zibo\ZiboException */ public function testIsOctalThrowsExceptionWhenNoNumericValueIsPassed($value) { Number::isOctal($value); }