コード例 #1
0
 /**
  * @covers       CollectionType\Map\MapAbstract::clear
  * @covers       CollectionType\Map\MapAbstract::__construct
  */
 public function testClearFilledMapForValues()
 {
     $key1 = '1';
     $value1 = '1';
     $this->dummyKeyType->isValid($key1)->willReturn(true);
     $this->dummyValueType->isValid($value1)->willReturn(true);
     $this->map->put($key1, $value1);
     $key2 = '2';
     $value2 = '2';
     $this->dummyKeyType->isValid($key2)->willReturn(true);
     $this->dummyValueType->isValid($value2)->willReturn(true);
     $this->map->put($key1, $value1);
     $this->map->clear();
     $result = $this->map->values();
     $this->assertEquals([], $result);
 }
コード例 #2
0
 /**
  * @covers       CollectionType\Map\MapAbstract::isEmpty
  * @covers       CollectionType\Map\MapAbstract::__construct
  * @covers       CollectionType\Map\MapAbstract::isSynchronizedIndex
  */
 public function testIsEmptyForEmptyMap()
 {
     $this->map->clear();
     $result = $this->map->isEmpty();
     $this->assertTrue($result);
 }
コード例 #3
0
 /**
  * @covers       CollectionType\Map\MapAbstract::count
  * @covers       CollectionType\Map\MapAbstract::__construct
  * @covers       CollectionType\Map\MapAbstract::isSynchronizedIndex
  */
 public function testCountForEmptyMap()
 {
     $this->map->clear();
     $result = $this->map->count();
     $this->assertEquals(0, $result);
 }