25 $collectorCodes = array_keys($allCollectors);
26 $collectorPos = array_search($collectorCode, $collectorCodes);
27 $this->assertNotSame(
false, $collectorPos,
"'{$collectorCode}' total collector is not found");
29 foreach ($before as $compareWithCode) {
30 $compareWithPos = array_search($compareWithCode, $collectorCodes);
31 if ($compareWithPos ===
false) {
34 $this->assertLessThan(
37 "The '{$collectorCode}' collector must go before '{$compareWithCode}'" 41 foreach ($after as $compareWithCode) {
42 $compareWithPos = array_search($compareWithCode, $collectorCodes);
43 if ($compareWithPos ===
false) {
46 $this->assertGreaterThan(
49 "The '{$collectorCode}' collector must go after '{$compareWithCode}'" 63 switch ($configType) {
65 $configClass = \Magento\Quote\Model\Quote\Address\Total\Collector::class;
66 $methodGetCollectors =
'getCollectors';
69 $configClass = \Magento\Sales\Model\Order\Invoice\Config::class;
70 $methodGetCollectors =
'getTotalModels';
73 $configClass = \Magento\Sales\Model\Order\Creditmemo\Config::class;
74 $methodGetCollectors =
'getTotalModels';
77 throw new \InvalidArgumentException(
'Unknown config type: ' . $configType);
80 return $config->{$methodGetCollectors}();
88 abstract public function collectorPositionDataProvider();
static _getConfigCollectors($configType)
testCollectorPosition($collectorCode, $configType, array $before, array $after)
static getObjectManager()