36 $this->connection = $this->getMockBuilder(\
Magento\Framework\DB\Adapter\AdapterInterface::class)
38 $this->resource = $this->getMockBuilder(\
Magento\Framework\
App\ResourceConnection::class)
39 ->disableOriginalConstructor()
41 $this->flatScopeResolver = $this->getMockBuilder(
42 \
Magento\Framework\Indexer\ScopeResolver\FlatScopeResolver::class
44 ->disableOriginalConstructor()
46 $this->resource->expects($this->any())
47 ->method(
'getConnection')
49 ->willReturn($this->connection);
52 $this->flatScopeResolver
61 $this->flatScopeResolver->expects($this->once())
65 $this->connection->expects($this->once())
66 ->method(
'isTableExists')
69 $this->connection->expects($this->once())
73 $this->
object->delete(
$index);
81 'type' =>
'searchable',
89 $table = $this->getMockBuilder(\
Magento\Framework\DB\Ddl\Table::class)
90 ->disableOriginalConstructor()
92 $this->flatScopeResolver->expects($this->once())
96 $this->connection->expects($this->once())
100 $table->expects($this->any())
101 ->method(
'addColumn')
104 [
'entity_id',
Table::TYPE_INTEGER, 10, [
'unsigned' =>
true,
'nullable' =>
false],
'Entity ID'],
108 $this->connection->expects($this->once())
109 ->method(
'createTable')
111 $this->resource->expects($this->once())
112 ->method(
'getIdxName')
114 ->willReturn($idxName);
115 $table->expects($this->once())
const INDEX_TYPE_FULLTEXT