Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 9169132

Browse files
committed
MAGETWO-90109: Customer Grid Indexer not working #10838
1 parent 0933c7a commit 9169132

File tree

1 file changed

+1
-45
lines changed

1 file changed

+1
-45
lines changed

lib/internal/Magento/Framework/Indexer/Test/Unit/Handler/AttributeHandlerTest.php

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,6 @@
55
*/
66
declare(strict_types=1);
77

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-
258
namespace Magento\Framework\Indexer\Test\Unit\Handler;
269

2710
use Magento\Framework\Indexer\Handler\AttributeHandler;
@@ -33,13 +16,6 @@ function method_exists($object, $method_name)
3316
*/
3417
class AttributeHandlerTest extends \PHPUnit\Framework\TestCase
3518
{
36-
/**
37-
* Static field responsible for mocking built-in method_exists function result.
38-
*
39-
* @var bool
40-
*/
41-
public static $methodExits = false;
42-
4319
/**
4420
* @var SourceProviderInterface|\PHPUnit_Framework_MockObject_MockObject
4521
*/
@@ -65,24 +41,6 @@ protected function setUp()
6541
$this->subject = $objectManager->getObject(AttributeHandler::class);
6642
}
6743

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-
8644
public function testPrepareSqlWithBindAndExistingJoinAttributeMethod()
8745
{
8846
$alias = 'e';
@@ -92,10 +50,9 @@ public function testPrepareSqlWithBindAndExistingJoinAttributeMethod()
9250
'type' => 'searchable',
9351
'dataType' => 'varchar',
9452
'entity' => 'customer',
95-
'bind' => '',
53+
'bind' => 'test',
9654
];
9755

98-
self::$methodExits = true;
9956
$this->source->expects($this->once())
10057
->method('joinAttribute')
10158
->with(
@@ -119,7 +76,6 @@ public function testPrepareSqlWithoutBind()
11976
'type' => 'searchable',
12077
'dataType' => 'varchar',
12178
'entity' => 'customer',
122-
'bind' => null,
12379
];
12480
$this->source->expects($this->once())
12581
->method('addFieldToSelect')

0 commit comments

Comments
 (0)