示例#1
0
 public function testAddProductNameFilter()
 {
     $collection = $this->collection->addProductNameFilter('TestProductName');
     $sql = $collection->getSelect()->__toString();
     $sql = trim(preg_replace('/\\s+/', ' ', $sql));
     $this->assertEquals(trim(preg_replace('/\\s+/', ' ', $this->sql)), $sql);
 }
示例#2
0
 public function testAddProductNameFilter()
 {
     $entityMetadata = $this->getMockBuilder('Magento\\Framework\\EntityManager\\EntityMetadata')->disableOriginalConstructor()->getMock();
     $entityMetadata->expects($this->once())->method('getLinkField')->willReturn('entity_id');
     $this->metadataPool->expects($this->once())->method('getMetadata')->with(ProductInterface::class)->willReturn($entityMetadata);
     $collection = $this->collection->addProductNameFilter('TestProductName');
     $sql = $collection->getSelect()->__toString();
     $sql = trim(preg_replace('/\\s+/', ' ', $sql));
     $this->assertEquals(trim(preg_replace('/\\s+/', ' ', $this->sql)), $sql);
 }