当前位置: 首页>>代码示例>>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;未经允许,请勿转载。