29 $this->_adapterMock = $this->createMock(\
Magento\Framework\DB\Adapter\AdapterInterface::class);
31 $this->_resourceMock = $this->createMock(\
Magento\Framework\
App\ResourceConnection::class);
32 $this->_resourceMock->expects($this->any())
33 ->method(
'getConnection')
35 ->will($this->returnValue($this->_adapterMock));
37 $this->_model = $this->getMockForAbstractClass(
39 [$this->_resourceMock,
'prefix'],
55 $this->assertEquals($expected, $this->_model->escapeLikeValue(
$data[
'value'],
$data[
'options']));
64 $this->_adapterMock->expects($this->once())
65 ->method(
'quoteIdentifier')
67 ->will($this->returnArgument(0));
69 $this->_model->expects($this->once())
70 ->method(
'addLikeEscape')
72 ->will($this->returnArgument(0));
75 $this->assertInstanceOf(
'Zend_Db_Expr',
$result);
76 $this->assertEquals($field .
' LIKE ' .
$value, (
string)
$result);
95 'value' =>
'LIKE %string_end',
102 'value' =>
'LIKE %string_end',
104 'allow_symbol_mask' =>
true,
111 'value' =>
'LIKE %string_end',
113 'allow_string_mask' =>
true,
120 'value' =>
'LIKE %string_end',
122 'allow_symbol_mask' =>
true,
123 'allow_string_mask' =>
true,
141 'position' =>
'start',
testEscapeLikeValue($expected, array $data)
escapeLikeValueDataProvider()