當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Container::remove方法代碼示例

本文整理匯總了PHP中Container::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::remove方法的具體用法?PHP Container::remove怎麽用?PHP Container::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Container的用法示例。


在下文中一共展示了Container::remove方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testHasAndRemove

 /**
  * @param mixed $definition
  *
  * @dataProvider providerDefinitions
  */
 public function testHasAndRemove($definition)
 {
     $di = new Container();
     $di->set('test', $definition);
     $this->assertTrue($di->has('test'));
     $di->remove('test');
     $this->assertFalse($di->has('test'));
 }
開發者ID:lebran,項目名稱:container,代碼行數:13,代碼來源:ContainerTest.php

示例2: remove

 public function remove($key)
 {
     $key = $this->findKey($key);
     if ($key === false) {
         return;
     }
     return parent::remove($key);
 }
開發者ID:RUSHUI,項目名稱:course-offcn-php-framework,代碼行數:8,代碼來源:casecontainer.php

示例3: Container

 function test_generic_container()
 {
     $comp = new Container(new FlowLayout(), MENU, 5);
     $c = new Component("Hello!", FOOTER, 4);
     $c1 = $comp->add($c, "12px", "2em", LEFT, BOTTOM);
     $this->assertReference($c1, $c);
     $this->assertReference($comp->getComponent(1), $c);
     $this->assertIdentical($comp->getComponentWidth(1), "12px");
     $this->assertIdentical($comp->getComponentHeight(1), "2em");
     $this->assertIdentical($comp->getComponentAlignmentX(1), LEFT);
     $this->assertIdentical($comp->getComponentAlignmentY(1), BOTTOM);
     $this->assertIdentical($comp->getComponentsCount(), 1);
     $c = new Component("Hello!", MENU_ITEM_LINK_SELECTED, 2);
     $c2 = $comp->add($c, "16px", "6em", RIGHT, CENTER);
     $this->assertReference($c2, $c);
     $this->assertReference($comp->getComponent(2), $c);
     $this->assertIdentical($comp->getComponentsCount(), 2);
     $c = new Component("Hello!", MENU_ITEM_LINK_UNSELECTED, 5);
     $c3 = $comp->add($c, "6px", "2em", CENTER, TOP);
     $this->assertReference($c3, $c);
     $this->assertReference($comp->getComponent(3), $c);
     $this->assertIdentical($comp->getComponentsCount(), 3);
     $c = $comp->remove(2);
     $this->assertReference($c, $c2);
     $this->assertNull($comp->getComponent(2));
     $this->assertIdentical($comp->getComponentsCount(), 2);
     $comp->removeAll();
     $this->assertIdentical($comp->_components, array());
     $this->assertIdentical($comp->getComponentsCount(), 0);
 }
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:30,代碼來源:ComponentsTestCase.class.php

示例4: testRemove

 /**
  * @param Container $container
  * @depends testMakeContainer
  */
 public function testRemove(Container $container)
 {
     $this->assertEquals('H', $container->remove('h'));
     $this->assertFalse($container->has('h'));
 }
開發者ID:chemisus,項目名稱:container,代碼行數:9,代碼來源:ObjectContainerTest.php


注:本文中的Container::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。