| @@ -4,17 +4,17 @@ | ||
| 4 | 4 | * Set error reporting to maximum | 
| 5 | 5 | */ | 
| 6 | 6 | error_reporting( -1 ); | 
| 7 | -ini_set( 'display_errors', true ); | |
| 7 | +ini_set('display_errors', true); | |
| 8 | 8 | |
| 9 | -date_default_timezone_set( 'UTC' ); | |
| 9 | +date_default_timezone_set('UTC'); | |
| 10 | 10 | |
| 11 | 11 | /* | 
| 12 | 12 | * Set locale settings to reasonable defaults | 
| 13 | 13 | */ | 
| 14 | -setlocale( LC_ALL, 'en_US.UTF-8' ); | |
| 15 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); | |
| 16 | -setlocale( LC_NUMERIC, 'POSIX' ); | |
| 17 | -setlocale( LC_TIME, 'POSIX' ); | |
| 14 | +setlocale(LC_ALL, 'en_US.UTF-8'); | |
| 15 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); | |
| 16 | +setlocale(LC_NUMERIC, 'POSIX'); | |
| 17 | +setlocale(LC_TIME, 'POSIX'); | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | require_once 'TestHelper.php'; | 
| @@ -8,122 +8,122 @@ | ||
| 8 | 8 | |
| 9 | 9 | return array( | 
| 10 | 10 | 'table' => array( | 
| 11 | -		'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { | |
| 11 | +		'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) { | |
| 12 | 12 | |
| 13 | - $table = $schema->createTable( 'ezuser' ); | |
| 13 | +			$table = $schema->createTable('ezuser'); | |
| 14 | 14 | |
| 15 | - $table->addColumn( 'contentobject_id', 'integer', array() ); | |
| 16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); | |
| 17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); | |
| 18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); | |
| 19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); | |
| 20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); | |
| 15 | +			$table->addColumn('contentobject_id', 'integer', array()); | |
| 16 | +			$table->addColumn('email', 'string', array('length' => 150)); | |
| 17 | +			$table->addColumn('login', 'string', array('length' => 150)); | |
| 18 | +			$table->addColumn('login_normalized', 'string', array('length' => 150)); | |
| 19 | +			$table->addColumn('password_hash', 'string', array('length' => 50)); | |
| 20 | +			$table->addColumn('password_hash_type', 'integer', array('default' => 1)); | |
| 21 | 21 | |
| 22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); | |
| 23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); | |
| 22 | +			$table->setPrimaryKey(array('contentobject_id')); | |
| 23 | +			$table->addUniqueIndex(array('login_normalized'), 'ezuser_login'); | |
| 24 | 24 | |
| 25 | 25 | return $schema; | 
| 26 | 26 | }, | 
| 27 | 27 | |
| 28 | -		'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { | |
| 29 | - | |
| 30 | - $table = $schema->createTable( 'ezuser_address' ); | |
| 31 | - | |
| 32 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); | |
| 33 | - $table->addColumn( 'siteid', 'integer', array() ); | |
| 34 | - $table->addColumn( 'parentid', 'integer', array() ); | |
| 35 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); | |
| 36 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); | |
| 37 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); | |
| 38 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); | |
| 39 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); | |
| 40 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); | |
| 41 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); | |
| 42 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); | |
| 43 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); | |
| 44 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); | |
| 45 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); | |
| 46 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); | |
| 47 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); | |
| 48 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); | |
| 49 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); | |
| 50 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); | |
| 51 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); | |
| 52 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); | |
| 53 | - $table->addColumn( 'flag', 'integer', array() ); | |
| 54 | - $table->addColumn( 'pos', 'smallint', array() ); | |
| 55 | - $table->addColumn( 'mtime', 'datetime', array() ); | |
| 56 | - $table->addColumn( 'ctime', 'datetime', array() ); | |
| 57 | -			$table->addColumn( 'editor', 'string', array('length' => 255 ) ); | |
| 58 | - | |
| 59 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); | |
| 60 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); | |
| 61 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); | |
| 62 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); | |
| 63 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); | |
| 64 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); | |
| 65 | - | |
| 66 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), | |
| 67 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); | |
| 28 | +		'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { | |
| 29 | + | |
| 30 | +			$table = $schema->createTable('ezuser_address'); | |
| 31 | + | |
| 32 | +			$table->addColumn('id', 'integer', array('autoincrement' => true)); | |
| 33 | +			$table->addColumn('siteid', 'integer', array()); | |
| 34 | +			$table->addColumn('parentid', 'integer', array()); | |
| 35 | +			$table->addColumn('company', 'string', array('length' => 100)); | |
| 36 | +			$table->addColumn('vatid', 'string', array('length' => 32)); | |
| 37 | +			$table->addColumn('salutation', 'string', array('length' => 8)); | |
| 38 | +			$table->addColumn('title', 'string', array('length' => 64)); | |
| 39 | +			$table->addColumn('firstname', 'string', array('length' => 64)); | |
| 40 | +			$table->addColumn('lastname', 'string', array('length' => 64)); | |
| 41 | +			$table->addColumn('address1', 'string', array('length' => 255)); | |
| 42 | +			$table->addColumn('address2', 'string', array('length' => 255)); | |
| 43 | +			$table->addColumn('address3', 'string', array('length' => 255)); | |
| 44 | +			$table->addColumn('postal', 'string', array('length' => 16)); | |
| 45 | +			$table->addColumn('city', 'string', array('length' => 255)); | |
| 46 | +			$table->addColumn('state', 'string', array('length' => 255)); | |
| 47 | +			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); | |
| 48 | +			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); | |
| 49 | +			$table->addColumn('telephone', 'string', array('length' => 32)); | |
| 50 | +			$table->addColumn('email', 'string', array('length' => 255)); | |
| 51 | +			$table->addColumn('telefax', 'string', array('length' => 255)); | |
| 52 | +			$table->addColumn('website', 'string', array('length' => 255)); | |
| 53 | +			$table->addColumn('flag', 'integer', array()); | |
| 54 | +			$table->addColumn('pos', 'smallint', array()); | |
| 55 | +			$table->addColumn('mtime', 'datetime', array()); | |
| 56 | +			$table->addColumn('ctime', 'datetime', array()); | |
| 57 | +			$table->addColumn('editor', 'string', array('length' => 255)); | |
| 58 | + | |
| 59 | +			$table->setPrimaryKey(array('id'), 'pk_ezpad_id'); | |
| 60 | +			$table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn'); | |
| 61 | +			$table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2'); | |
| 62 | +			$table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci'); | |
| 63 | +			$table->addIndex(array('parentid'), 'idx_ezpad_pid'); | |
| 64 | +			$table->addIndex(array('city'), 'idx_ezpad_city'); | |
| 65 | + | |
| 66 | +			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), | |
| 67 | +				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid'); | |
| 68 | 68 | |
| 69 | 69 | return $schema; | 
| 70 | 70 | }, | 
| 71 | 71 | |
| 72 | -		'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { | |
| 72 | +		'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { | |
| 73 | 73 | |
| 74 | - $table = $schema->createTable( 'ezuser_list_type' ); | |
| 74 | +			$table = $schema->createTable('ezuser_list_type'); | |
| 75 | 75 | |
| 76 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); | |
| 77 | - $table->addColumn( 'siteid', 'integer', array() ); | |
| 78 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); | |
| 79 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); | |
| 80 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); | |
| 81 | - $table->addColumn( 'status', 'smallint', array() ); | |
| 82 | - $table->addColumn( 'mtime', 'datetime', array() ); | |
| 83 | - $table->addColumn( 'ctime', 'datetime', array() ); | |
| 84 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); | |
| 76 | +			$table->addColumn('id', 'integer', array('autoincrement' => true)); | |
| 77 | +			$table->addColumn('siteid', 'integer', array()); | |
| 78 | +			$table->addColumn('domain', 'string', array('length' => 32)); | |
| 79 | +			$table->addColumn('code', 'string', array('length' => 32)); | |
| 80 | +			$table->addColumn('label', 'string', array('length' => 255)); | |
| 81 | +			$table->addColumn('status', 'smallint', array()); | |
| 82 | +			$table->addColumn('mtime', 'datetime', array()); | |
| 83 | +			$table->addColumn('ctime', 'datetime', array()); | |
| 84 | +			$table->addColumn('editor', 'string', array('length' => 255)); | |
| 85 | 85 | |
| 86 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); | |
| 87 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); | |
| 88 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); | |
| 89 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); | |
| 90 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); | |
| 86 | +			$table->setPrimaryKey(array('id'), 'pk_ezplity_id'); | |
| 87 | +			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code'); | |
| 88 | +			$table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status'); | |
| 89 | +			$table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label'); | |
| 90 | +			$table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code'); | |
| 91 | 91 | |
| 92 | 92 | return $schema; | 
| 93 | 93 | }, | 
| 94 | 94 | |
| 95 | -		'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { | |
| 96 | - | |
| 97 | - $table = $schema->createTable( 'ezuser_list' ); | |
| 98 | - | |
| 99 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); | |
| 100 | - $table->addColumn( 'parentid', 'integer', array() ); | |
| 101 | - $table->addColumn( 'siteid', 'integer', array() ); | |
| 102 | - $table->addColumn( 'typeid', 'integer', array() ); | |
| 103 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); | |
| 104 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); | |
| 105 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); | |
| 106 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); | |
| 107 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); | |
| 108 | - $table->addColumn( 'pos', 'integer', array() ); | |
| 109 | - $table->addColumn( 'status', 'smallint', array() ); | |
| 110 | - $table->addColumn( 'mtime', 'datetime', array() ); | |
| 111 | - $table->addColumn( 'ctime', 'datetime', array() ); | |
| 112 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); | |
| 113 | - | |
| 114 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); | |
| 115 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); | |
| 116 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); | |
| 117 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); | |
| 118 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); | |
| 119 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); | |
| 120 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); | |
| 121 | - | |
| 122 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), | |
| 123 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); | |
| 124 | - | |
| 125 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), | |
| 126 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); | |
| 95 | +		'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { | |
| 96 | + | |
| 97 | +			$table = $schema->createTable('ezuser_list'); | |
| 98 | + | |
| 99 | +			$table->addColumn('id', 'integer', array('autoincrement' => true)); | |
| 100 | +			$table->addColumn('parentid', 'integer', array()); | |
| 101 | +			$table->addColumn('siteid', 'integer', array()); | |
| 102 | +			$table->addColumn('typeid', 'integer', array()); | |
| 103 | +			$table->addColumn('domain', 'string', array('length' => 32)); | |
| 104 | +			$table->addColumn('refid', 'string', array('length' => 32)); | |
| 105 | +			$table->addColumn('start', 'datetime', array('notnull' => false)); | |
| 106 | +			$table->addColumn('end', 'datetime', array('notnull' => false)); | |
| 107 | +			$table->addColumn('config', 'text', array('length' => 0xffff)); | |
| 108 | +			$table->addColumn('pos', 'integer', array()); | |
| 109 | +			$table->addColumn('status', 'smallint', array()); | |
| 110 | +			$table->addColumn('mtime', 'datetime', array()); | |
| 111 | +			$table->addColumn('ctime', 'datetime', array()); | |
| 112 | +			$table->addColumn('editor', 'string', array('length' => 255)); | |
| 113 | + | |
| 114 | +			$table->setPrimaryKey(array('id'), 'pk_ezpli_id'); | |
| 115 | +			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid'); | |
| 116 | +			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end'); | |
| 117 | +			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid'); | |
| 118 | +			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start'); | |
| 119 | +			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end'); | |
| 120 | +			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos'); | |
| 121 | + | |
| 122 | +			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), | |
| 123 | +				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid'); | |
| 124 | + | |
| 125 | +			$table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'), | |
| 126 | +				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid'); | |
| 127 | 127 | |
| 128 | 128 | return $schema; | 
| 129 | 129 | }, | 
| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | */ | 
| 22 | 22 | public function getPostDependencies() | 
| 23 | 23 |  	{ | 
| 24 | - return array( 'MShopAddTypeData' ); | |
| 24 | +		return array('MShopAddTypeData'); | |
| 25 | 25 | } | 
| 26 | 26 | |
| 27 | 27 | |
| @@ -30,15 +30,15 @@ discard block | ||
| 30 | 30 | */ | 
| 31 | 31 | public function migrate() | 
| 32 | 32 |  	{ | 
| 33 | - $this->msg( 'Creating Aimeos ezPublish tables', 0 ); | |
| 34 | - $this->status( '' ); | |
| 33 | +		$this->msg('Creating Aimeos ezPublish tables', 0); | |
| 34 | +		$this->status(''); | |
| 35 | 35 | |
| 36 | 36 | $ds = DIRECTORY_SEPARATOR; | 
| 37 | 37 | |
| 38 | 38 | $files = array( | 
| 39 | - 'db-customer' => __DIR__ . $ds . 'default' . $ds . 'schema' . $ds . 'customer.php', | |
| 39 | + 'db-customer' => __DIR__.$ds.'default'.$ds.'schema'.$ds.'customer.php', | |
| 40 | 40 | ); | 
| 41 | 41 | |
| 42 | - $this->setupSchema( $files ); | |
| 42 | + $this->setupSchema($files); | |
| 43 | 43 | } | 
| 44 | 44 | } | 
| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | */ | 
| 22 | 22 | public function getPreDependencies() | 
| 23 | 23 |  	{ | 
| 24 | - return array( 'TablesCreateEzpublish' ); | |
| 24 | +		return array('TablesCreateEzpublish'); | |
| 25 | 25 | } | 
| 26 | 26 | |
| 27 | 27 | |
| @@ -30,12 +30,12 @@ discard block | ||
| 30 | 30 | */ | 
| 31 | 31 | public function migrate() | 
| 32 | 32 |  	{ | 
| 33 | - $this->msg( 'Adding address fields to ezuser table', 0 ); | |
| 33 | +		$this->msg('Adding address fields to ezuser table', 0); | |
| 34 | 34 | |
| 35 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); | |
| 35 | +		$dbal = $this->getConnection('db-customer')->getRawObject(); | |
| 36 | 36 | |
| 37 | -		if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { | |
| 38 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); | |
| 37 | +		if (!($dbal instanceof \Doctrine\DBAL\Connection)) { | |
| 38 | +			throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); | |
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | 41 | |
| @@ -43,17 +43,17 @@ discard block | ||
| 43 | 43 | $comparator = new \Doctrine\DBAL\Schema\Comparator(); | 
| 44 | 44 | $toSchema = clone $fromSchema; | 
| 45 | 45 | |
| 46 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); | |
| 47 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); | |
| 46 | +		$this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); | |
| 47 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); | |
| 48 | 48 | |
| 49 | - if( $sql !== array() ) | |
| 49 | + if ($sql !== array()) | |
| 50 | 50 |  		{ | 
| 51 | - $this->executeList( $sql, 'db-customer' ); | |
| 52 | - $this->status( 'done' ); | |
| 51 | + $this->executeList($sql, 'db-customer'); | |
| 52 | +			$this->status('done'); | |
| 53 | 53 | } | 
| 54 | 54 | else | 
| 55 | 55 |  		{ | 
| 56 | - $this->status( 'OK' ); | |
| 56 | +			$this->status('OK'); | |
| 57 | 57 | } | 
| 58 | 58 | } | 
| 59 | 59 | |
| @@ -64,38 +64,38 @@ discard block | ||
| 64 | 64 | * @param \Doctrine\DBAL\Schema\Table $table Table object | 
| 65 | 65 | * @return \Doctrine\DBAL\Schema\Table Updated table object | 
| 66 | 66 | */ | 
| 67 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) | |
| 67 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) | |
| 68 | 68 |  	{ | 
| 69 | 69 | $columns = array( | 
| 70 | - 'company' => array( 'string', array( 'length' => 100 ) ), | |
| 71 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), | |
| 72 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), | |
| 73 | - 'title' => array( 'string', array( 'length' => 64 ) ), | |
| 74 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), | |
| 75 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), | |
| 76 | - 'address1' => array( 'string', array( 'length' => 255 ) ), | |
| 77 | - 'address2' => array( 'string', array( 'length' => 255 ) ), | |
| 78 | - 'address3' => array( 'string', array( 'length' => 255 ) ), | |
| 79 | - 'postal' => array( 'string', array( 'length' => 16 ) ), | |
| 80 | - 'city' => array( 'string', array( 'length' => 255 ) ), | |
| 81 | - 'state' => array( 'string', array( 'length' => 255 ) ), | |
| 82 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), | |
| 83 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), | |
| 84 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), | |
| 85 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), | |
| 86 | - 'website' => array( 'string', array( 'length' => 255 ) ), | |
| 87 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), | |
| 88 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), | |
| 89 | - 'status' => array( 'smallint', array() ), | |
| 90 | - 'mtime' => array( 'datetime', array() ), | |
| 91 | - 'ctime' => array( 'datetime', array() ), | |
| 92 | - 'editor' => array( 'string', array( 'length' => 255 ) ), | |
| 70 | +			'company' => array('string', array('length' => 100)), | |
| 71 | +			'vatid' => array('string', array('length' => 32)), | |
| 72 | +			'salutation' => array('string', array('length' => 8)), | |
| 73 | +			'title' => array('string', array('length' => 64)), | |
| 74 | +			'firstname' => array('string', array('length' => 64)), | |
| 75 | +			'lastname' => array('string', array('length' => 64)), | |
| 76 | +			'address1' => array('string', array('length' => 255)), | |
| 77 | +			'address2' => array('string', array('length' => 255)), | |
| 78 | +			'address3' => array('string', array('length' => 255)), | |
| 79 | +			'postal' => array('string', array('length' => 16)), | |
| 80 | +			'city' => array('string', array('length' => 255)), | |
| 81 | +			'state' => array('string', array('length' => 255)), | |
| 82 | +			'langid' => array('string', array('length' => 5, 'notnull' => false)), | |
| 83 | +			'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), | |
| 84 | +			'telephone' => array('string', array('length' => 32)), | |
| 85 | +			'telefax' => array('string', array('length' => 32)), | |
| 86 | +			'website' => array('string', array('length' => 255)), | |
| 87 | +			'birthday' => array('date', array('notnull' => false)), | |
| 88 | +			'vdate' => array('date', array('notnull' => false)), | |
| 89 | +			'status' => array('smallint', array()), | |
| 90 | +			'mtime' => array('datetime', array()), | |
| 91 | +			'ctime' => array('datetime', array()), | |
| 92 | +			'editor' => array('string', array('length' => 255)), | |
| 93 | 93 | ); | 
| 94 | 94 | |
| 95 | - foreach( $columns as $name => $def ) | |
| 95 | + foreach ($columns as $name => $def) | |
| 96 | 96 |  		{ | 
| 97 | -			if( $table->hasColumn( $name ) === false ) { | |
| 98 | - $table->addColumn( $name, $def[0], $def[1] ); | |
| 97 | +			if ($table->hasColumn($name) === false) { | |
| 98 | + $table->addColumn($name, $def[0], $def[1]); | |
| 99 | 99 | } | 
| 100 | 100 | } | 
| 101 | 101 | |
| @@ -109,23 +109,23 @@ discard block | ||
| 109 | 109 | * @param \Doctrine\DBAL\Schema\Table $table Table object | 
| 110 | 110 | * @return \Doctrine\DBAL\Schema\Table Updated table object | 
| 111 | 111 | */ | 
| 112 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) | |
| 112 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) | |
| 113 | 113 |  	{ | 
| 114 | 114 | $indexes = array( | 
| 115 | - 'idx_ezpus_langid' => array( 'langid' ), | |
| 116 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), | |
| 117 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), | |
| 118 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), | |
| 119 | - 'idx_ezpus_lastname' => array( 'lastname' ), | |
| 120 | - 'idx_ezpus_address1' => array( 'address1' ), | |
| 121 | - 'idx_ezpus_postal' => array( 'postal' ), | |
| 122 | - 'idx_ezpus_city' => array( 'city' ), | |
| 115 | +			'idx_ezpus_langid' => array('langid'), | |
| 116 | +			'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), | |
| 117 | +			'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), | |
| 118 | +			'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), | |
| 119 | +			'idx_ezpus_lastname' => array('lastname'), | |
| 120 | +			'idx_ezpus_address1' => array('address1'), | |
| 121 | +			'idx_ezpus_postal' => array('postal'), | |
| 122 | +			'idx_ezpus_city' => array('city'), | |
| 123 | 123 | ); | 
| 124 | 124 | |
| 125 | - foreach( $indexes as $name => $def ) | |
| 125 | + foreach ($indexes as $name => $def) | |
| 126 | 126 |  		{ | 
| 127 | -			if( $table->hasIndex( $name ) === false ) { | |
| 128 | - $table->addIndex( $def, $name ); | |
| 127 | +			if ($table->hasIndex($name) === false) { | |
| 128 | + $table->addIndex($def, $name); | |
| 129 | 129 | } | 
| 130 | 130 | } | 
| 131 | 131 | |
| @@ -18,14 +18,14 @@ discard block | ||
| 18 | 18 | |
| 19 | 19 | $includepaths = $aimeos->getIncludePaths(); | 
| 20 | 20 | $includepaths[] = get_include_path(); | 
| 21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); | |
| 21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); | |
| 22 | 22 | } | 
| 23 | 23 | |
| 24 | 24 | |
| 25 | - public static function getContext( $site = 'unittest' ) | |
| 25 | + public static function getContext($site = 'unittest') | |
| 26 | 26 |  	{ | 
| 27 | -		if( !isset( self::$context[$site] ) ) { | |
| 28 | - self::$context[$site] = self::createContext( $site ); | |
| 27 | +		if (!isset(self::$context[$site])) { | |
| 28 | + self::$context[$site] = self::createContext($site); | |
| 29 | 29 | } | 
| 30 | 30 | |
| 31 | 31 | return clone self::$context[$site]; | 
| @@ -34,13 +34,13 @@ discard block | ||
| 34 | 34 | |
| 35 | 35 | private static function getAimeos() | 
| 36 | 36 |  	{ | 
| 37 | - if( !isset( self::$aimeos ) ) | |
| 37 | + if (!isset(self::$aimeos)) | |
| 38 | 38 |  		{ | 
| 39 | 39 | require_once 'Bootstrap.php'; | 
| 40 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); | |
| 40 | +			spl_autoload_register('Aimeos\\Bootstrap::autoload'); | |
| 41 | 41 | |
| 42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); | |
| 43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); | |
| 42 | + $extdir = dirname(dirname(dirname(__DIR__))); | |
| 43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); | |
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | return self::$aimeos; | 
| @@ -50,45 +50,45 @@ discard block | ||
| 50 | 50 | /** | 
| 51 | 51 | * @param string $site | 
| 52 | 52 | */ | 
| 53 | - private static function createContext( $site ) | |
| 53 | + private static function createContext($site) | |
| 54 | 54 |  	{ | 
| 55 | 55 | $ctx = new \Aimeos\MShop\Context\Item\Ezpublish(); | 
| 56 | 56 | $aimeos = self::getAimeos(); | 
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | $paths = $aimeos->getConfigPaths(); | 
| 60 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; | |
| 60 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; | |
| 61 | 61 | |
| 62 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); | |
| 63 | - $ctx->setConfig( $conf ); | |
| 62 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); | |
| 63 | + $ctx->setConfig($conf); | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf ); | |
| 67 | - $ctx->setDatabaseManager( $dbm ); | |
| 66 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($conf); | |
| 67 | + $ctx->setDatabaseManager($dbm); | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); | |
| 71 | - $ctx->setLogger( $logger ); | |
| 70 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); | |
| 71 | + $ctx->setLogger($logger); | |
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | $cache = new \Aimeos\MW\Cache\None(); | 
| 75 | - $ctx->setCache( $cache ); | |
| 75 | + $ctx->setCache($cache); | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); | |
| 79 | - $ctx->setI18n( array( 'de' => $i18n ) ); | |
| 78 | +		$i18n = new \Aimeos\MW\Translation\None('de'); | |
| 79 | +		$ctx->setI18n(array('de' => $i18n)); | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | $session = new \Aimeos\MW\Session\None(); | 
| 83 | - $ctx->setSession( $session ); | |
| 83 | + $ctx->setSession($session); | |
| 84 | 84 | |
| 85 | 85 | |
| 86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); | |
| 87 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); | |
| 86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); | |
| 87 | + $localeItem = $localeManager->bootstrap($site, '', '', false); | |
| 88 | 88 | |
| 89 | - $ctx->setLocale( $localeItem ); | |
| 89 | + $ctx->setLocale($localeItem); | |
| 90 | 90 | |
| 91 | - $ctx->setEditor( 'ai-ezpublish:unittest' ); | |
| 91 | +		$ctx->setEditor('ai-ezpublish:unittest'); | |
| 92 | 92 | |
| 93 | 93 | return $ctx; | 
| 94 | 94 | } | 
| @@ -16,39 +16,39 @@ | ||
| 16 | 16 | |
| 17 | 17 | protected function setUp() | 
| 18 | 18 |  	{ | 
| 19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); | |
| 19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); | |
| 20 | 20 | |
| 21 | - $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); | |
| 22 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); | |
| 21 | +		$listManager = $manager->getSubManager('lists', 'Ezpublish'); | |
| 22 | +		$this->object = $listManager->getSubManager('type', 'Ezpublish'); | |
| 23 | 23 | } | 
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() | 
| 27 | 27 |  	{ | 
| 28 | - unset( $this->object ); | |
| 28 | + unset($this->object); | |
| 29 | 29 | } | 
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | public function testCleanup() | 
| 33 | 33 |  	{ | 
| 34 | - $this->object->cleanup( array( -1 ) ); | |
| 34 | + $this->object->cleanup(array( -1 )); | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testGetSearchAttributes() | 
| 39 | 39 |  	{ | 
| 40 | 40 | $attributes = $this->object->getSearchAttributes(); | 
| 41 | - $this->assertGreaterThan( 0, count( $attributes ) ); | |
| 41 | + $this->assertGreaterThan(0, count($attributes)); | |
| 42 | 42 | |
| 43 | -		foreach( $attributes as $attribute ) { | |
| 44 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute ); | |
| 43 | +		foreach ($attributes as $attribute) { | |
| 44 | +			$this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute); | |
| 45 | 45 | } | 
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGetSubManager() | 
| 50 | 50 |  	{ | 
| 51 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 52 | - $this->object->getSubManager( 'unknown' ); | |
| 51 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 52 | +		$this->object->getSubManager('unknown'); | |
| 53 | 53 | } | 
| 54 | 54 | } | 
| @@ -16,57 +16,57 @@ | ||
| 16 | 16 | |
| 17 | 17 | protected function setUp() | 
| 18 | 18 |  	{ | 
| 19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); | |
| 20 | - $this->object = $manager->getSubManager( 'lists', 'Ezpublish' ); | |
| 19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); | |
| 20 | +		$this->object = $manager->getSubManager('lists', 'Ezpublish'); | |
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() | 
| 25 | 25 |  	{ | 
| 26 | - unset( $this->object ); | |
| 26 | + unset($this->object); | |
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | public function testCleanup() | 
| 31 | 31 |  	{ | 
| 32 | - $this->object->cleanup( array( -1 ) ); | |
| 32 | + $this->object->cleanup(array( -1 )); | |
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | public function testGetSearchAttributes() | 
| 37 | 37 |  	{ | 
| 38 | 38 | $attributes = $this->object->getSearchAttributes(); | 
| 39 | - $this->assertGreaterThan( 0, count( $attributes ) ); | |
| 39 | + $this->assertGreaterThan(0, count($attributes)); | |
| 40 | 40 | |
| 41 | -		foreach( $attributes as $attribute ) { | |
| 42 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute ); | |
| 41 | +		foreach ($attributes as $attribute) { | |
| 42 | +			$this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute); | |
| 43 | 43 | } | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | public function testGetSubManager() | 
| 48 | 48 |  	{ | 
| 49 | -		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); | |
| 50 | -		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); | |
| 49 | +		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); | |
| 50 | +		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); | |
| 51 | 51 | |
| 52 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 53 | - $this->object->getSubManager( 'unknown' ); | |
| 52 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 53 | +		$this->object->getSubManager('unknown'); | |
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testSaveItemInvalidItem() | 
| 58 | 58 |  	{ | 
| 59 | - $this->setExpectedException( '\Aimeos\MShop\Exception' ); | |
| 60 | - $this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) ); | |
| 59 | +		$this->setExpectedException('\Aimeos\MShop\Exception'); | |
| 60 | +		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.lists.type.')); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testSaveItemInvalidDomain() | 
| 65 | 65 |  	{ | 
| 66 | 66 | $item = $this->object->createItem(); | 
| 67 | - $item->setDomain( 'customer/group' ); | |
| 67 | +		$item->setDomain('customer/group'); | |
| 68 | 68 | |
| 69 | - $this->setExpectedException( '\Aimeos\MShop\Customer\Exception' ); | |
| 70 | - $this->object->saveItem( $item ); | |
| 69 | +		$this->setExpectedException('\Aimeos\MShop\Customer\Exception'); | |
| 70 | + $this->object->saveItem($item); | |
| 71 | 71 | } | 
| 72 | 72 | } | 
| @@ -16,44 +16,44 @@ | ||
| 16 | 16 | |
| 17 | 17 | protected function setUp() | 
| 18 | 18 |  	{ | 
| 19 | - $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( \TestHelper::getContext() ); | |
| 19 | + $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish(\TestHelper::getContext()); | |
| 20 | 20 | |
| 21 | - $this->object = $customer->getSubManager( 'address', 'Ezpublish' ); | |
| 21 | +		$this->object = $customer->getSubManager('address', 'Ezpublish'); | |
| 22 | 22 | } | 
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | protected function tearDown() | 
| 26 | 26 |  	{ | 
| 27 | - unset( $this->object ); | |
| 27 | + unset($this->object); | |
| 28 | 28 | } | 
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCleanup() | 
| 32 | 32 |  	{ | 
| 33 | - $this->object->cleanup( array( -1 ) ); | |
| 33 | + $this->object->cleanup(array( -1 )); | |
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | public function testDeleteItems() | 
| 38 | 38 |  	{ | 
| 39 | - $this->object->deleteItems( array( -1 ) ); | |
| 39 | + $this->object->deleteItems(array( -1 )); | |
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | public function testGetSearchAttributes() | 
| 44 | 44 |  	{ | 
| 45 | 45 | $attributes = $this->object->getSearchAttributes(); | 
| 46 | - $this->assertGreaterThan( 0, count( $attributes ) ); | |
| 46 | + $this->assertGreaterThan(0, count($attributes)); | |
| 47 | 47 | |
| 48 | -		foreach( $attributes as $attribute ) { | |
| 49 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); | |
| 48 | +		foreach ($attributes as $attribute) { | |
| 49 | +			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); | |
| 50 | 50 | } | 
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | public function testGetSubManager() | 
| 55 | 55 |  	{ | 
| 56 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 57 | - $this->object->getSubManager( 'unknown' ); | |
| 56 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 57 | +		$this->object->getSubManager('unknown'); | |
| 58 | 58 | } | 
| 59 | 59 | } | 
| @@ -18,91 +18,91 @@ | ||
| 18 | 18 | protected function setUp() | 
| 19 | 19 |  	{ | 
| 20 | 20 | $this->context = \TestHelper::getContext(); | 
| 21 | - $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context ); | |
| 21 | + $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish($this->context); | |
| 22 | 22 | |
| 23 | - $this->object = $customer->getSubManager( 'group', 'Ezpublish' ); | |
| 23 | +		$this->object = $customer->getSubManager('group', 'Ezpublish'); | |
| 24 | 24 | } | 
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() | 
| 28 | 28 |  	{ | 
| 29 | - unset( $this->object ); | |
| 29 | + unset($this->object); | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testCleanup() | 
| 34 | 34 |  	{ | 
| 35 | - $this->object->cleanup( array( -1 ) ); | |
| 35 | + $this->object->cleanup(array( -1 )); | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testDeleteItems() | 
| 40 | 40 |  	{ | 
| 41 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 42 | - $this->object->deleteItems( array( -1 ) ); | |
| 41 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 42 | + $this->object->deleteItems(array( -1 )); | |
| 43 | 43 | } | 
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | public function testGetSearchAttributes() | 
| 47 | 47 |  	{ | 
| 48 | 48 | $attributes = $this->object->getSearchAttributes(); | 
| 49 | - $this->assertGreaterThan( 0, count( $attributes ) ); | |
| 49 | + $this->assertGreaterThan(0, count($attributes)); | |
| 50 | 50 | |
| 51 | -		foreach( $attributes as $attribute ) { | |
| 52 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); | |
| 51 | +		foreach ($attributes as $attribute) { | |
| 52 | +			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); | |
| 53 | 53 | } | 
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testGetSubManager() | 
| 58 | 58 |  	{ | 
| 59 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 60 | - $this->object->getSubManager( 'unknown' ); | |
| 59 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 60 | +		$this->object->getSubManager('unknown'); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testSaveItem() | 
| 65 | 65 |  	{ | 
| 66 | - $this->setExpectedException( '\\Aimeos\\MShop\\Customer\\Exception' ); | |
| 67 | - $this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) ); | |
| 66 | +		$this->setExpectedException('\\Aimeos\\MShop\\Customer\\Exception'); | |
| 67 | +		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Lists\Standard('common.lists.')); | |
| 68 | 68 | } | 
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | public function testSearchItems() | 
| 72 | 72 |  	{ | 
| 73 | - $mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' ) | |
| 74 | - ->setConstructorArgs( array( \TestHelper::getContext() ) ) | |
| 75 | - ->setMethods( array( 'searchItemsBase' ) ) | |
| 73 | +		$mock = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Group\Ezpublish') | |
| 74 | + ->setConstructorArgs(array(\TestHelper::getContext())) | |
| 75 | +			->setMethods(array('searchItemsBase')) | |
| 76 | 76 | ->getMock(); | 
| 77 | 77 | |
| 78 | - $result = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' ) | |
| 79 | - ->setMethods( array( 'affectedRows', 'fetch', 'finish', 'nextResult' ) ) | |
| 78 | +		$result = $this->getMockBuilder('\Aimeos\MW\DB\Result\Iface') | |
| 79 | +			->setMethods(array('affectedRows', 'fetch', 'finish', 'nextResult')) | |
| 80 | 80 | ->getMock(); | 
| 81 | 81 | |
| 82 | - $mock->expects( $this->once() )->method( 'searchItemsBase' ) | |
| 83 | - ->will( $this->returnValue( $result ) ); | |
| 82 | +		$mock->expects($this->once())->method('searchItemsBase') | |
| 83 | + ->will($this->returnValue($result)); | |
| 84 | 84 | |
| 85 | - $result->expects( $this->exactly( 2 ) )->method( 'fetch' ) | |
| 86 | - ->will( $this->onConsecutiveCalls( array( 'customer.group.id' => 1 ), false ) ); | |
| 85 | +		$result->expects($this->exactly(2))->method('fetch') | |
| 86 | +			->will($this->onConsecutiveCalls(array('customer.group.id' => 1), false)); | |
| 87 | 87 | |
| 88 | - $result = $mock->searchItems( $mock->createSearch() ); | |
| 88 | + $result = $mock->searchItems($mock->createSearch()); | |
| 89 | 89 | |
| 90 | - $this->assertEquals( 1, count( $result ) ); | |
| 91 | - $this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Group\Iface', $result[1] ); | |
| 90 | + $this->assertEquals(1, count($result)); | |
| 91 | +		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Group\Iface', $result[1]); | |
| 92 | 92 | } | 
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | public function testSearchItemsException() | 
| 96 | 96 |  	{ | 
| 97 | - $mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' ) | |
| 98 | - ->setConstructorArgs( array( \TestHelper::getContext() ) ) | |
| 99 | - ->setMethods( array( 'searchItemsBase' ) ) | |
| 97 | +		$mock = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Group\Ezpublish') | |
| 98 | + ->setConstructorArgs(array(\TestHelper::getContext())) | |
| 99 | +			->setMethods(array('searchItemsBase')) | |
| 100 | 100 | ->getMock(); | 
| 101 | 101 | |
| 102 | - $mock->expects( $this->once() )->method( 'searchItemsBase' ) | |
| 103 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); | |
| 102 | +		$mock->expects($this->once())->method('searchItemsBase') | |
| 103 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); | |
| 104 | 104 | |
| 105 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); | |
| 106 | - $mock->searchItems( $mock->createSearch() ); | |
| 105 | +		$this->setExpectedException('\\Aimeos\\MShop\\Exception'); | |
| 106 | + $mock->searchItems($mock->createSearch()); | |
| 107 | 107 | } | 
| 108 | 108 | } |