Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function up() |
||
32 | { |
||
33 | $this->info( 'Adding order basket test data', 'vv' ); |
||
34 | |||
35 | $context = $this->context()->setEditor( 'core' ); |
||
|
|||
36 | |||
37 | $ds = DIRECTORY_SEPARATOR; |
||
38 | $path = __DIR__ . $ds . 'data' . $ds . 'order-basket.php'; |
||
39 | |||
40 | if( ( $testdata = include( $path ) ) == false ) { |
||
41 | throw new \RuntimeException( sprintf( 'No file "%1$s" found for order baskets', $path ) ); |
||
42 | } |
||
43 | |||
44 | $manager = \Aimeos\MShop::create( $context, 'order/basket', 'Standard' ); |
||
45 | |||
46 | foreach( $testdata as $entry ) { |
||
47 | $manager->save( $manager->create()->fromArray( $entry, true ) )->setCustomerId( $this->getCustomer()->getId() ); |
||
48 | } |
||
58 |