| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | protected function process() |
||
| 46 | { |
||
| 47 | $path = __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'group.php'; |
||
| 48 | |||
| 49 | if( ( $testdata = include( $path ) ) == false ) { |
||
| 50 | throw new \RuntimeException( sprintf( 'No file "%1$s" found for group domain', $path ) ); |
||
| 51 | } |
||
| 52 | |||
| 53 | $manager = $this->getManager( 'group' ); |
||
| 54 | $manager->begin(); |
||
| 55 | |||
| 56 | $items = []; |
||
| 57 | foreach( $testdata['group'] as $entry ) |
||
| 58 | { |
||
| 59 | try { |
||
| 60 | $manager->save( $manager->find( $entry['group.code'] )->fromArray( $entry ) ); |
||
| 61 | } catch( \Exception $e ) { |
||
| 62 | $manager->save( $manager->create()->fromArray( $entry ), false ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | $manager->commit(); |
||
| 67 | } |
||
| 69 |