Conditions | 1 |
Paths | 1 |
Total Lines | 54 |
Code Lines | 44 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
13 | public function testProcess() |
||
14 | { |
||
15 | $context = \TestHelperCntl::getContext(); |
||
16 | $mapping = array( |
||
17 | 0 => 'order.base.product.type', |
||
18 | 1 => 'order.base.product.stocktype', |
||
19 | 2 => 'order.base.product.suppliercode', |
||
20 | 3 => 'order.base.product.prodcode', |
||
21 | 4 => 'order.base.product.productid', |
||
22 | 5 => 'order.base.product.quantity', |
||
23 | 6 => 'order.base.product.name', |
||
24 | 7 => 'order.base.product.mediaurl', |
||
25 | 8 => 'order.base.product.price', |
||
26 | 9 => 'order.base.product.costs', |
||
27 | 10 => 'order.base.product.rebate', |
||
28 | 11 => 'order.base.product.taxrate', |
||
29 | 12 => 'order.base.product.status', |
||
30 | 13 => 'order.base.product.position', |
||
31 | 14 => 'order.base.product.attribute.type', |
||
32 | 15 => 'order.base.product.attribute.code', |
||
33 | 16 => 'order.base.product.attribute.name', |
||
34 | 17 => 'order.base.product.attribute.value', |
||
35 | ); |
||
36 | |||
37 | |||
38 | $object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Product\Standard( $context, $mapping ); |
||
39 | |||
40 | $invoice = $this->getInvoice( $context ); |
||
41 | $order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() ); |
||
1 ignored issue
–
show
|
|||
42 | |||
43 | $data = $object->process( $invoice, $order ); |
||
44 | |||
45 | |||
46 | $this->assertEquals( 4, count( $data ) ); |
||
47 | |||
48 | $this->assertEquals( 18, count( $data[0] ) ); |
||
49 | $this->assertEquals( 'default', $data[0][0] ); |
||
50 | $this->assertEquals( 'unit_type1', $data[0][1] ); |
||
51 | $this->assertEquals( 'unitsupplier', $data[0][2] ); |
||
52 | $this->assertEquals( 'CNE', $data[0][3] ); |
||
53 | $this->assertGreaterThan( 0, $data[0][4] ); |
||
54 | $this->assertEquals( '9', $data[0][5] ); |
||
55 | $this->assertEquals( 'Cafe Noire Expresso', $data[0][6] ); |
||
56 | $this->assertEquals( 'somewhere/thump1.jpg', $data[0][7] ); |
||
57 | $this->assertEquals( '4.50', $data[0][8] ); |
||
58 | $this->assertEquals( '0.00', $data[0][9] ); |
||
59 | $this->assertEquals( '0.00', $data[0][10] ); |
||
60 | $this->assertEquals( '0.0000', $data[0][11] ); |
||
61 | $this->assertEquals( '1', $data[0][12] ); |
||
62 | $this->assertEquals( '1', $data[0][13] ); |
||
63 | $this->assertEquals( "default\ndefault\nconfig", $data[0][14] ); |
||
64 | $this->assertEquals( "width\nlength\ninterval", $data[0][15] ); |
||
65 | $this->assertEquals( "33\n36\nP0Y1M0W0D", $data[0][16] ); |
||
66 | $this->assertEquals( "33\n36\nP0Y1M0W0D", $data[0][17] ); |
||
67 | } |
||
86 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths