/** * This method tests the "isUpperCase" method. * * @dataProvider data_isUpperCase */ public function test_isUpperCase(array $provided, array $expected) { $p0 = IChar\Module::isUpperCase(IChar\Type::box($provided[0])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method tests the "covariant" method. * * @dataProvider data_covariant */ public function test_covariant(array $provided, array $expected) { $p0 = IChar\Type::covariant(IChar\Type::box($provided[0])); $this->assertInstanceOf('\\Saber\\Data\\IChar\\Type', $p0); $p1 = $p0->unbox(); $e1 = $expected[0]; $this->assertInternalType('string', $p1); $this->assertSame(1, strlen($p1)); $this->assertSame($e1, $p1); }
/** * This method returns the item at the specified index. * * @access public * @final * @param IInt32\Type $i the index of the item * @return IChar\Type the item at the specified index */ public final function item(IInt32\Type $i) : IChar\Type { return IChar\Type::box($this->__item($i)); }
/** * This method tests the "replicate" method. * * @dataProvider data_replicate */ public function test_replicate(array $provided, array $expected) { $p0 = IString\Type::replicate(IChar\Type::box($provided[0]), IInt32\Type::box($provided[1])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IString\\Type', $p0); $this->assertSame($e0, $p0->unbox(1)); }
/** * This method returns the corresponding upper case letter, if any. * * @access public * @static * @param IChar\Type $x the object to be converted * @return IChar\Type the upper case letter * * @see http://php.net/manual/en/function.mb-strtoupper.php */ public static function toUpperCase(IChar\Type $x) : IChar\Type { return IChar\Type::box(mb_strtoupper($x->unbox(), IChar\Type::UTF_8_ENCODING)); }