set() public method

public set ( $key, $value )
コード例 #1
0
 public function testSortCaseInsensitiveStringKeys()
 {
     if (PHP_VERSION_ID < 50400) {
         $this->markTestSkipped('SORT_FLAG_CASE not available');
     }
     $store = new SortableDecorator(new ArrayStore());
     $store->set('_Ac', 'A');
     $store->set('abc', 'F');
     $store->set('_ab', 'G');
     $store->set('ABB', 'E');
     $store->set('Bce', 'C');
     $store->set('bcd', 'D');
     $store->set('bCf', 'E');
     $store->sort(SORT_STRING | SORT_FLAG_CASE);
     $this->assertSame(array('_ab' => 'G', '_Ac' => 'A', 'ABB' => 'E', 'abc' => 'F', 'bcd' => 'D', 'Bce' => 'C', 'bCf' => 'E'), $store->getMultiple($store->keys()));
 }
コード例 #2
0
 public function testSetDelegate()
 {
     $this->innerStore->expects($this->once())->method('set')->with('key', 'value');
     $this->decorator->set('key', 'value');
 }