Esempio n. 1
0
 /**
  * This method returns a value as a boxed object.  A value is typically a PHP typed
  * primitive or object.  It is considered type-safe.
  *
  * @access public
  * @static
  * @param array $xss                                        the value(s) to be boxed
  * @return IHashMap\Type                                    the boxed object
  */
 public static function make(array $xss) : IHashMap\Type
 {
     // an array of tuples
     $zs = new IHashMap\Type();
     foreach ($xss as $xs) {
         $zs->putEntry($xs->first(), $xs->second());
     }
     return $zs;
 }
Esempio n. 2
0
 /**
  * This method tests that an item is put in the collection.
  *
  * @dataProvider dataPutEntry
  */
 public function testPutEntry(array $provided, array $expected)
 {
     //$this->markTestIncomplete();
     $p0 = new IHashMap\Type();
     foreach ($provided as $entry) {
         $p0->putEntry($entry->first(), $entry->second());
     }
     $p1 = $p0->size()->unbox();
     $e1 = $expected[0];
     $this->assertSame($e1, $p1);
 }