当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_MockObject_MockObject::calculateDependencies方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::calculateDependencies方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::calculateDependencies方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::calculateDependencies怎么用?PHP PHPUnit_Framework_MockObject_MockObject::calculateDependencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_MockObject_MockObject的用法示例。


在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::calculateDependencies方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCalculateDependencies

 /**
  * @covers ::calculateDependencies
  */
 public function testCalculateDependencies()
 {
     $target_entity_type_id = $this->randomMachineName(16);
     $target_entity_type = $this->getMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
     $target_entity_type->expects($this->any())->method('getProvider')->will($this->returnValue('test_module'));
     $values = array('targetEntityType' => $target_entity_type_id);
     $this->entityManager->expects($this->at(0))->method('getDefinition')->with($target_entity_type_id)->will($this->returnValue($target_entity_type));
     $this->entityManager->expects($this->at(1))->method('getDefinition')->with($this->entityType)->will($this->returnValue($this->entityInfo));
     $this->entity = $this->getMockBuilder('\\Drupal\\Core\\Entity\\EntityDisplayModeBase')->setConstructorArgs(array($values, $this->entityType))->setMethods(array('getFilterFormat'))->getMock();
     $dependencies = $this->entity->calculateDependencies()->getDependencies();
     $this->assertContains('test_module', $dependencies['module']);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:15,代码来源:EntityDisplayModeBaseUnitTest.php

示例2: testCalculateDependenciesWithThirdPartySettings

 /**
  * @covers ::calculateDependencies
  */
 public function testCalculateDependenciesWithThirdPartySettings()
 {
     $this->entity = $this->getMockForAbstractClass('\\Drupal\\Tests\\Core\\Config\\Entity\\Fixtures\\ConfigEntityBaseWithThirdPartySettings', array(array(), $this->entityTypeId));
     $this->entity->setThirdPartySetting('test_provider', 'test', 'test');
     $this->entity->setThirdPartySetting('test_provider2', 'test', 'test');
     $this->entity->setThirdPartySetting($this->provider, 'test', 'test');
     $this->assertEquals(array('test_provider', 'test_provider2'), $this->entity->calculateDependencies()['module']);
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:11,代码来源:ConfigEntityBaseUnitTest.php

示例3: testCalculateDependenciesTheme

 /**
  * @covers ::calculateDependencies
  */
 public function testCalculateDependenciesTheme()
 {
     $this->setUpEntity(array('name' => 'test', 'source' => 'test_theme', 'sourceType' => Breakpoint::SOURCE_TYPE_THEME));
     $breakpoint = $this->getMockBuilder('\\Drupal\\breakpoint\\Entity\\Breakpoint')->disableOriginalConstructor()->getMock();
     $breakpoint->expects($this->once())->method('getConfigDependencyName')->will($this->returnValue('breakpoint.breakpoint.test'));
     $this->entity->expects($this->once())->method('getBreakpoints')->will($this->returnValue(array($breakpoint)));
     $dependencies = $this->entity->calculateDependencies();
     $this->assertArrayNotHasKey('module', $dependencies);
     $this->assertContains('test_theme', $dependencies['theme']);
     $this->assertContains('breakpoint.breakpoint.test', $dependencies['entity']);
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:14,代码来源:BreakpointGroupConfigEntityUnitTest.php

示例4: testCalculateDependenciesWithThirdPartySettings

 /**
  * @covers ::calculateDependencies
  * @covers ::getDependencies
  * @covers ::onDependencyRemoval
  */
 public function testCalculateDependenciesWithThirdPartySettings()
 {
     $this->entity = $this->getMockForAbstractClass('\\Drupal\\Core\\Config\\Entity\\ConfigEntityBase', array(array(), $this->entityTypeId));
     $this->entity->setThirdPartySetting('test_provider', 'test', 'test');
     $this->entity->setThirdPartySetting('test_provider2', 'test', 'test');
     $this->entity->setThirdPartySetting($this->provider, 'test', 'test');
     $this->assertEquals(array('test_provider', 'test_provider2'), $this->entity->calculateDependencies()->getDependencies()['module']);
     $changed = $this->entity->onDependencyRemoval(['module' => ['test_provider2']]);
     $this->assertTrue($changed, 'Calling onDependencyRemoval with an existing third party dependency provider returns TRUE.');
     $changed = $this->entity->onDependencyRemoval(['module' => ['test_provider3']]);
     $this->assertFalse($changed, 'Calling onDependencyRemoval with a non-existing third party dependency provider returns FALSE.');
     $this->assertEquals(array('test_provider'), $this->entity->calculateDependencies()->getDependencies()['module']);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:18,代码来源:ConfigEntityBaseUnitTest.php

示例5: testCalculateDependenciesWithPluginBags

 /**
  * @covers ::calculateDependencies
  *
  * @dataProvider providerCalculateDependenciesWithPluginBags
  */
 public function testCalculateDependenciesWithPluginBags($definition, $expected_dependencies)
 {
     $values = array();
     $this->entity = $this->getMockBuilder('\\Drupal\\Tests\\Core\\Config\\Entity\\Fixtures\\ConfigEntityBaseWithPluginBags')->setConstructorArgs(array($values, $this->entityTypeId))->setMethods(array('getPluginBags'))->getMock();
     // Create a configurable plugin that would add a dependency.
     $instance_id = $this->randomName();
     $instance = new TestConfigurablePlugin(array(), $instance_id, $definition);
     // Create a plugin bag to contain the instance.
     $pluginBag = $this->getMockBuilder('\\Drupal\\Core\\Plugin\\DefaultPluginBag')->disableOriginalConstructor()->setMethods(array('get'))->getMock();
     $pluginBag->expects($this->atLeastOnce())->method('get')->with($instance_id)->will($this->returnValue($instance));
     $pluginBag->addInstanceId($instance_id);
     // Return the mocked plugin bag.
     $this->entity->expects($this->once())->method('getPluginBags')->will($this->returnValue(array($pluginBag)));
     $this->assertEquals($expected_dependencies, $this->entity->calculateDependencies());
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:20,代码来源:ConfigEntityBaseUnitTest.php

示例6: testCalculateDependencies

 /**
  * @covers ::calculateDependencies
  */
 public function testCalculateDependencies()
 {
     $this->assertSame([], $this->sut->calculateDependencies());
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:7,代码来源:PaymentStatusBaseTest.php


注:本文中的PHPUnit_Framework_MockObject_MockObject::calculateDependencies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。