5
5
*/
6
6
declare (strict_types=1 );
7
7
8
- // @codingStandardsIgnoreStart
9
- namespace Magento \Framework \Indexer \Handler ;
10
-
11
- /**
12
- * Mock method for built-in function method_exists.
13
- *
14
- * @param mixed $object
15
- * @param string $method_name
16
- * @return bool
17
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
18
- */
19
- function method_exists ($ object , $ method_name )
20
- {
21
- return \Magento \Framework \Indexer \Test \Unit \Handler \AttributeHandlerTest::$ methodExits ;
22
- }
23
- // codingStandardsIgnoreEnd
24
-
25
8
namespace Magento \Framework \Indexer \Test \Unit \Handler ;
26
9
27
10
use Magento \Framework \Indexer \Handler \AttributeHandler ;
@@ -33,13 +16,6 @@ function method_exists($object, $method_name)
33
16
*/
34
17
class AttributeHandlerTest extends \PHPUnit \Framework \TestCase
35
18
{
36
- /**
37
- * Static field responsible for mocking built-in method_exists function result.
38
- *
39
- * @var bool
40
- */
41
- public static $ methodExits = false ;
42
-
43
19
/**
44
20
* @var SourceProviderInterface|\PHPUnit_Framework_MockObject_MockObject
45
21
*/
@@ -65,24 +41,6 @@ protected function setUp()
65
41
$ this ->subject = $ objectManager ->getObject (AttributeHandler::class);
66
42
}
67
43
68
- public function testPrepareSqlWithBindAndMissingJoinAttributeMethod ()
69
- {
70
- $ alias = 'e ' ;
71
- $ fieldInfo = [
72
- 'name ' => 'is_approved ' ,
73
- 'origin ' => 'is_approved ' ,
74
- 'type ' => 'searchable ' ,
75
- 'dataType ' => 'varchar ' ,
76
- 'entity ' => 'customer ' ,
77
- 'bind ' => '' ,
78
- ];
79
-
80
- self ::$ methodExits = false ;
81
- $ this ->source ->expects ($ this ->never ())->method ('joinAttribute ' );
82
-
83
- $ this ->subject ->prepareSql ($ this ->source , $ alias , $ fieldInfo );
84
- }
85
-
86
44
public function testPrepareSqlWithBindAndExistingJoinAttributeMethod ()
87
45
{
88
46
$ alias = 'e ' ;
@@ -92,10 +50,9 @@ public function testPrepareSqlWithBindAndExistingJoinAttributeMethod()
92
50
'type ' => 'searchable ' ,
93
51
'dataType ' => 'varchar ' ,
94
52
'entity ' => 'customer ' ,
95
- 'bind ' => '' ,
53
+ 'bind ' => 'test ' ,
96
54
];
97
55
98
- self ::$ methodExits = true ;
99
56
$ this ->source ->expects ($ this ->once ())
100
57
->method ('joinAttribute ' )
101
58
->with (
@@ -119,7 +76,6 @@ public function testPrepareSqlWithoutBind()
119
76
'type ' => 'searchable ' ,
120
77
'dataType ' => 'varchar ' ,
121
78
'entity ' => 'customer ' ,
122
- 'bind ' => null ,
123
79
];
124
80
$ this ->source ->expects ($ this ->once ())
125
81
->method ('addFieldToSelect ' )
0 commit comments