Passed
Push — master ( b54e8f...276919 )
by Aimeos
07:04 queued 04:23
created

CustomerAddTypo3TestData::before()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
nc 1
nop 0
cc 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2014-2021
6
 */
7
8
9
namespace Aimeos\Upscheme\Task;
10
11
12
/**
13
 * Adds FOS user customer test data.
14
 */
15
class CustomerAddTypo3TestData extends CustomerAddTestData
16
{
17
	/**
18
	 * Returns the list of task names which this task depends on
19
	 *
20
	 * @return string[] List of task names
21
	 */
22
	public function after() : array
23
	{
24
		return ['Customer', 'Text', 'ProductAddTestData'];
25
	}
26
27
28
	/**
29
	 * Adds customer test data
30
	 */
31
	public function up()
32
	{
33
		$this->info( 'Adding TYPO3 customer test data', 'v' );
34
35
		$this->db( 'db-customer' )->exec( "DELETE FROM fe_users WHERE email LIKE 'test%@example.com'" );
36
37
		$this->context()->setEditor( 'ai-typo3:lib/custom' );
0 ignored issues
show
Bug introduced by
The method context() does not exist on Aimeos\Upscheme\Task\CustomerAddTypo3TestData. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
		$this->/** @scrutinizer ignore-call */ 
38
         context()->setEditor( 'ai-typo3:lib/custom' );
Loading history...
38
		$this->process();
39
	}
40
41
42
	/**
43
	 * Returns the manager for the current setup task
44
	 *
45
	 * @param string $domain Domain name of the manager
46
	 * @return \Aimeos\MShop\Common\Manager\Iface Manager object
47
	 */
48
	protected function getManager( string $domain ) : \Aimeos\MShop\Common\Manager\Iface
49
	{
50
		if( $domain === 'customer' ) {
51
			return \Aimeos\MShop\Customer\Manager\Factory::create( $this->context(), 'Typo3' );
52
		}
53
54
		return parent::getManager( $domain );
55
	}
56
}
57