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


PHP PHPUnit_Framework_MockObject_MockObject::setId方法代码示例

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


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

示例1: testGetAttributeById

 public function testGetAttributeById()
 {
     $this->productResource->expects($this->any())->method('loadAllAttributes')->will($this->returnValue($this->productResource));
     $this->productResource->expects($this->any())->method('getSortedAttributes')->will($this->returnValue([$this->attribute]));
     $this->attribute->setId(1);
     $this->assertEquals($this->attribute, $this->model->getAttributeById(1, $this->product));
     $this->assertNull($this->model->getAttributeById(0, $this->product));
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:8,代码来源:AbstractTypeTest.php

示例2: testHasChildThemes

 /**
  * @test
  * @return void
  */
 public function testHasChildThemes()
 {
     $this->_model->setId(1);
     $this->resourceCollection->expects($this->once())->method('addTypeFilter')->with(Theme::TYPE_VIRTUAL)->willReturnSelf();
     $this->resourceCollection->expects($this->once())->method('addFieldToFilter')->with('parent_id', ['eq' => 1])->willReturnSelf();
     $this->resourceCollection->expects($this->once())->method('getSize')->willReturn(10);
     $this->assertTrue($this->_model->hasChildThemes());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:ThemeTest.php

示例3: testIsCanDelete

 public function testIsCanDelete()
 {
     $this->assertFalse($this->model->isCanDelete());
     $this->model->load(1);
     $this->assertFalse($this->model->isCanDelete());
     $this->model->setId(100);
     $this->assertFalse($this->model->isCanDelete());
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:8,代码来源:StoreTest.php

示例4: testSetOrder

 public function testSetOrder()
 {
     $orderId = 1111;
     $storeId = 2221;
     $this->orderMock->setId($orderId);
     $this->orderMock->setStoreId($storeId);
     $this->assertNull($this->model->getOrderId());
     $this->assertNull($this->model->getStoreId());
     $this->assertEquals($this->model, $this->model->setOrder($this->orderMock));
     $this->assertEquals($this->orderMock, $this->model->getOrder());
     $this->assertEquals($orderId, $this->model->getOrderId());
     $this->assertEquals($storeId, $this->model->getStoreId());
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:13,代码来源:InvoiceTest.php

示例5: deleteModelSuccessfully

 /**
  * Callback for delete method in mocked model
  */
 public function deleteModelSuccessfully()
 {
     $this->_model->setId(null);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:7,代码来源:EntityTest.php

示例6: testProcessTemplate

 public function testProcessTemplate()
 {
     $this->mockModel();
     $this->model->setId('customer_create_account_email_template');
     $this->assertContains('<body', $this->model->processTemplate());
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:6,代码来源:TemplateTest.php

示例7: testGetCustomViewConfigPath

 /**
  * @covers \Magento\Framework\View\Design\Theme\Customization\Path::getCustomViewConfigPath
  */
 public function testGetCustomViewConfigPath()
 {
     $expectedPath = implode('/', [\Magento\Framework\View\Design\Theme\Customization\Path::DIR_NAME, '123', \Magento\Framework\View\ConfigInterface::CONFIG_FILE_NAME]);
     $this->assertEquals($expectedPath, $this->_model->getCustomViewConfigPath($this->_theme->setId(123)));
     $this->assertNull($this->_model->getCustomViewConfigPath($this->_theme->setId(null)));
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:9,代码来源:PathTest.php

示例8: testSetId

 /**
  * @param \PHPUnit_Framework_MockObject_MockObject $criteria
  * @return \PHPUnit_Framework_MockObject_MockObject
  *
  * @depends testImplementCriteriaInterface
  * @covers Sellsy\Criteria\Generic\GetOneCriteria::setId
  */
 public function testSetId(\PHPUnit_Framework_MockObject_MockObject $criteria)
 {
     $criteria->setId(12);
     $this->assertEquals(12, $criteria->getId());
     return $criteria;
 }
开发者ID:mehdi-ghezal,项目名称:sellsy-api,代码行数:13,代码来源:GetListOne.php


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