public function testInvalidate() { /** @var IndexerInterface|\PHPUnit_Framework_MockObject_MockObject $indexerMock */ $indexerMock = $this->getMockBuilder('Magento\\Framework\\Indexer\\IndexerInterface')->getMockForAbstractClass(); $this->indexerRegistryMock->expects($this->once())->method('get')->with(Customer::CUSTOMER_GRID_INDEXER_ID)->willReturn($indexerMock); $indexerMock->expects($this->once())->method('invalidate'); $this->attribute->invalidate(); }