示例#1
0
 /**
  * This method tests the "toString" method.
  *
  * @dataProvider data_toString
  */
 public function test_toString(array $provided, array $expected)
 {
     $p0 = IChar\Type::make($provided[0])->toString();
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IString\\Type', $p0);
     $this->assertSame($e0, $p0->unbox());
 }
示例#2
0
 /**
  * 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());
 }
示例#3
0
 /**
  * This method appends the specified object to this object's string.
  *
  * @access public
  * @static
  * @param IString\Type $xs                                  the left operand
  * @param IChar\Type $y                                     the object to be appended
  * @return IString\Type                                     the string
  */
 public static function append(IString\Type $xs, IChar\Type $y) : IString\Type
 {
     return IString\Type::box($xs->unbox() . $y->unbox());
 }
示例#4
0
 /**
  * This method tests that a value is appended.
  *
  * @dataProvider dataAppend
  */
 public function testAppend(array $provided, array $expected)
 {
     $this->markTestIncomplete();
     $p0 = IString\Type::make($provided[0])->append(IChar\Type::make($provided[1]));
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IString\\Type', $p0);
     $this->assertSame($e0, $p0->unbox());
 }
示例#5
0
 /**
  * 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));
 }
示例#6
0
 /**
  * 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));
 }
示例#7
0
 /**
  * This method returns whether this character is an upper case character.
  *
  * @access public
  * @static
  * @param IChar\Type $x                                     the character to be evaluated
  * @return IBool\Type                                       whether this is an upper case
  *                                                          character
  *
  * @see http://php.net/manual/en/function.ctype-upper.php
  */
 public static function isUpperCase(IChar\Type $x) : IBool\Type
 {
     return IBool\Type::box(ctype_upper($x->unbox()));
 }