@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @param Container $container Container object to access parameters |
| 30 | 30 | */ |
| 31 | - public function __construct( Container $container ) |
|
| 31 | + public function __construct(Container $container) |
|
| 32 | 32 | { |
| 33 | 33 | $this->container = $container; |
| 34 | 34 | } |
@@ -40,23 +40,23 @@ discard block |
||
| 40 | 40 | * @param string $pageName Name of the configured page |
| 41 | 41 | * @return array Associative list with body and header output separated by client name |
| 42 | 42 | */ |
| 43 | - public function getSections( $pageName ) |
|
| 43 | + public function getSections($pageName) |
|
| 44 | 44 | { |
| 45 | 45 | $context = $this->container->get('aimeos_context')->get(); |
| 46 | - $pagesConfig = $this->container->getParameter( 'aimeos_shop.page' ); |
|
| 47 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
| 46 | + $pagesConfig = $this->container->getParameter('aimeos_shop.page'); |
|
| 47 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
| 48 | 48 | |
| 49 | 49 | $langid = $context->getLocale()->getLanguageId(); |
| 50 | - $tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths( 'client/html/templates' ); |
|
| 51 | - $view = $this->container->get('aimeos_view')->create( $context, $tmplPaths, $langid ); |
|
| 52 | - $context->setView( $view ); |
|
| 50 | + $tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths('client/html/templates'); |
|
| 51 | + $view = $this->container->get('aimeos_view')->create($context, $tmplPaths, $langid); |
|
| 52 | + $context->setView($view); |
|
| 53 | 53 | |
| 54 | - if( isset( $pagesConfig[$pageName] ) ) |
|
| 54 | + if (isset($pagesConfig[$pageName])) |
|
| 55 | 55 | { |
| 56 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
| 56 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
| 57 | 57 | { |
| 58 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
| 59 | - $client->setView( clone $view ); |
|
| 58 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
| 59 | + $client->setView(clone $view); |
|
| 60 | 60 | $client->process(); |
| 61 | 61 | |
| 62 | 62 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | $kernel = $this->createKernel(); |
| 17 | 17 | $kernel->boot(); |
| 18 | 18 | |
| 19 | - $application = new Application( $kernel ); |
|
| 20 | - $application->add( new Command\AccountCommand() ); |
|
| 19 | + $application = new Application($kernel); |
|
| 20 | + $application->add(new Command\AccountCommand()); |
|
| 21 | 21 | |
| 22 | - $command = $application->find( 'aimeos:account' ); |
|
| 23 | - $commandTester = new CommandTester( $command ); |
|
| 24 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test' ) ); |
|
| 22 | + $command = $application->find('aimeos:account'); |
|
| 23 | + $commandTester = new CommandTester($command); |
|
| 24 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test')); |
|
| 25 | 25 | |
| 26 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
| 26 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | $kernel = $this->createKernel(); |
| 33 | 33 | $kernel->boot(); |
| 34 | 34 | |
| 35 | - $application = new Application( $kernel ); |
|
| 36 | - $application->add( new Command\AccountCommand() ); |
|
| 35 | + $application = new Application($kernel); |
|
| 36 | + $application->add(new Command\AccountCommand()); |
|
| 37 | 37 | |
| 38 | - $command = $application->find( 'aimeos:account' ); |
|
| 39 | - $commandTester = new CommandTester( $command ); |
|
| 40 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test', '--admin' => true ) ); |
|
| 38 | + $command = $application->find('aimeos:account'); |
|
| 39 | + $commandTester = new CommandTester($command); |
|
| 40 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test', '--admin' => true)); |
|
| 41 | 41 | |
| 42 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
| 42 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -186,8 +186,7 @@ |
||
| 186 | 186 | try |
| 187 | 187 | { |
| 188 | 188 | $item = $manager->findItem( $code ); |
| 189 | - } |
|
| 190 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 189 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 191 | 190 | { |
| 192 | 191 | $item = $manager->createItem(); |
| 193 | 192 | $item->setLabel( $code ); |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | protected function configure() |
| 31 | 31 | { |
| 32 | - $this->setName( 'aimeos:account'); |
|
| 33 | - $this->setDescription( 'Creates new (admin) accounts' ); |
|
| 34 | - $this->addArgument( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ); |
|
| 35 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' ); |
|
| 36 | - $this->addOption( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ); |
|
| 37 | - $this->addOption( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ); |
|
| 38 | - $this->addOption( 'editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges' ); |
|
| 32 | + $this->setName('aimeos:account'); |
|
| 33 | + $this->setDescription('Creates new (admin) accounts'); |
|
| 34 | + $this->addArgument('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'); |
|
| 35 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)'); |
|
| 36 | + $this->addOption('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'); |
|
| 37 | + $this->addOption('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'); |
|
| 38 | + $this->addOption('editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -45,32 +45,32 @@ discard block |
||
| 45 | 45 | * @param InputInterface $input Input object |
| 46 | 46 | * @param OutputInterface $output Output object |
| 47 | 47 | */ |
| 48 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
| 48 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 49 | 49 | { |
| 50 | - $code = $input->getArgument( 'email' ); |
|
| 51 | - if( ( $password = $input->getOption( 'password' ) ) === null ) |
|
| 50 | + $code = $input->getArgument('email'); |
|
| 51 | + if (($password = $input->getOption('password')) === null) |
|
| 52 | 52 | { |
| 53 | - $helper = $this->getHelper( 'question' ); |
|
| 54 | - $question = new Question( 'Password' ); |
|
| 55 | - $question->setHidden( true ); |
|
| 53 | + $helper = $this->getHelper('question'); |
|
| 54 | + $question = new Question('Password'); |
|
| 55 | + $question->setHidden(true); |
|
| 56 | 56 | |
| 57 | - $password = $helper->ask( $input, $output, $question ); |
|
| 57 | + $password = $helper->ask($input, $output, $question); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $context = $this->getContainer()->get( 'aimeos_context' )->get( false, 'command' ); |
|
| 61 | - $context->setEditor( 'aimeos:account' ); |
|
| 60 | + $context = $this->getContainer()->get('aimeos_context')->get(false, 'command'); |
|
| 61 | + $context->setEditor('aimeos:account'); |
|
| 62 | 62 | |
| 63 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 64 | - $context->setLocale( $localeManager->createItem() ); |
|
| 63 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 64 | + $context->setLocale($localeManager->createItem()); |
|
| 65 | 65 | |
| 66 | - $user = $this->createCustomerItem( $context, $code, $password ); |
|
| 66 | + $user = $this->createCustomerItem($context, $code, $password); |
|
| 67 | 67 | |
| 68 | - if( $input->getOption( 'admin' ) ) { |
|
| 69 | - $this->addGroup( $input, $output, $context, $user, 'admin' ); |
|
| 68 | + if ($input->getOption('admin')) { |
|
| 69 | + $this->addGroup($input, $output, $context, $user, 'admin'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if( $input->getOption( 'editor' ) ) { |
|
| 73 | - $this->addGroup( $input, $output, $context, $user, 'editor' ); |
|
| 72 | + if ($input->getOption('editor')) { |
|
| 73 | + $this->addGroup($input, $output, $context, $user, 'editor'); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -84,24 +84,24 @@ discard block |
||
| 84 | 84 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
| 85 | 85 | * @param string $group Unique customer group code |
| 86 | 86 | */ |
| 87 | - protected function addGroup( InputInterface $input, OutputInterface $output, |
|
| 88 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group ) |
|
| 87 | + protected function addGroup(InputInterface $input, OutputInterface $output, |
|
| 88 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group) |
|
| 89 | 89 | { |
| 90 | - $output->writeln( sprintf( 'Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode() ) ); |
|
| 90 | + $output->writeln(sprintf('Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode())); |
|
| 91 | 91 | |
| 92 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 92 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 93 | 93 | |
| 94 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
| 94 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
| 95 | 95 | { |
| 96 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 96 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 97 | 97 | |
| 98 | 98 | $lcontext = clone $context; |
| 99 | - $lcontext->setLocale( $localeItem ); |
|
| 99 | + $lcontext->setLocale($localeItem); |
|
| 100 | 100 | |
| 101 | - $output->writeln( '- ' . $siteItem->getCode() ); |
|
| 101 | + $output->writeln('- '.$siteItem->getCode()); |
|
| 102 | 102 | |
| 103 | - $groupItem = $this->getGroupItem( $lcontext, $group ); |
|
| 104 | - $this->addListItem( $lcontext, $user->getId(), $groupItem->getId() ); |
|
| 103 | + $groupItem = $this->getGroupItem($lcontext, $group); |
|
| 104 | + $this->addListItem($lcontext, $user->getId(), $groupItem->getId()); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -113,31 +113,31 @@ discard block |
||
| 113 | 113 | * @param string $userid Unique user ID |
| 114 | 114 | * @param string $groupid Unique group ID |
| 115 | 115 | */ |
| 116 | - protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
|
| 116 | + protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid) |
|
| 117 | 117 | { |
| 118 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' ); |
|
| 119 | - $typeid = $manager->getSubmanager( 'type' )->findItem( 'default', array(), 'customer/group' )->getId(); |
|
| 118 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists'); |
|
| 119 | + $typeid = $manager->getSubmanager('type')->findItem('default', array(), 'customer/group')->getId(); |
|
| 120 | 120 | |
| 121 | 121 | $search = $manager->createSearch(); |
| 122 | 122 | $expr = array( |
| 123 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
| 124 | - $search->compare( '==', 'customer.lists.refid', $groupid ), |
|
| 125 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
| 126 | - $search->compare( '==', 'customer.lists.typeid', $typeid ), |
|
| 123 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
| 124 | + $search->compare('==', 'customer.lists.refid', $groupid), |
|
| 125 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
| 126 | + $search->compare('==', 'customer.lists.typeid', $typeid), |
|
| 127 | 127 | ); |
| 128 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 129 | - $search->setSlice( 0, 1 ); |
|
| 128 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 129 | + $search->setSlice(0, 1); |
|
| 130 | 130 | |
| 131 | - if( count( $manager->searchItems( $search ) ) === 0 ) |
|
| 131 | + if (count($manager->searchItems($search)) === 0) |
|
| 132 | 132 | { |
| 133 | 133 | $item = $manager->createItem(); |
| 134 | - $item->setDomain( 'customer/group' ); |
|
| 135 | - $item->setParentId( $userid ); |
|
| 136 | - $item->setTypeId( $typeid ); |
|
| 137 | - $item->setRefId( $groupid ); |
|
| 138 | - $item->setStatus( 1 ); |
|
| 134 | + $item->setDomain('customer/group'); |
|
| 135 | + $item->setParentId($userid); |
|
| 136 | + $item->setTypeId($typeid); |
|
| 137 | + $item->setRefId($groupid); |
|
| 138 | + $item->setStatus(1); |
|
| 139 | 139 | |
| 140 | - $manager->saveItem( $item, false ); |
|
| 140 | + $manager->saveItem($item, false); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
@@ -152,23 +152,23 @@ discard block |
||
| 152 | 152 | * @param string $password New user password |
| 153 | 153 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
| 154 | 154 | */ |
| 155 | - protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
|
| 155 | + protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password) |
|
| 156 | 156 | { |
| 157 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 157 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 158 | 158 | |
| 159 | 159 | try { |
| 160 | - $item = $manager->findItem( $email ); |
|
| 161 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 160 | + $item = $manager->findItem($email); |
|
| 161 | + } catch (\Aimeos\MShop\Exception $e) { |
|
| 162 | 162 | $item = $manager->createItem(); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $item->setCode( $email ); |
|
| 166 | - $item->setLabel( $email ); |
|
| 167 | - $item->getPaymentAddress()->setEmail( $email ); |
|
| 168 | - $item->setPassword( $password ); |
|
| 169 | - $item->setStatus( 1 ); |
|
| 165 | + $item->setCode($email); |
|
| 166 | + $item->setLabel($email); |
|
| 167 | + $item->getPaymentAddress()->setEmail($email); |
|
| 168 | + $item->setPassword($password); |
|
| 169 | + $item->setStatus(1); |
|
| 170 | 170 | |
| 171 | - $manager->saveItem( $item ); |
|
| 171 | + $manager->saveItem($item); |
|
| 172 | 172 | |
| 173 | 173 | return $item; |
| 174 | 174 | } |
@@ -181,21 +181,21 @@ discard block |
||
| 181 | 181 | * @param string $code Unique customer group code |
| 182 | 182 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
| 183 | 183 | */ |
| 184 | - protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
|
| 184 | + protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code) |
|
| 185 | 185 | { |
| 186 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' ); |
|
| 186 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group'); |
|
| 187 | 187 | |
| 188 | 188 | try |
| 189 | 189 | { |
| 190 | - $item = $manager->findItem( $code ); |
|
| 190 | + $item = $manager->findItem($code); |
|
| 191 | 191 | } |
| 192 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 192 | + catch (\Aimeos\MShop\Exception $e) |
|
| 193 | 193 | { |
| 194 | 194 | $item = $manager->createItem(); |
| 195 | - $item->setLabel( $code ); |
|
| 196 | - $item->setCode( $code ); |
|
| 195 | + $item->setLabel($code); |
|
| 196 | + $item->setCode($code); |
|
| 197 | 197 | |
| 198 | - $manager->saveItem( $item ); |
|
| 198 | + $manager->saveItem($item); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return $item; |
@@ -12,66 +12,66 @@ discard block |
||
| 12 | 12 | $client = static::createClient(array(), array( |
| 13 | 13 | 'PHP_AUTH_USER' => 'UTC001', |
| 14 | 14 | 'PHP_AUTH_PW' => 'unittest', |
| 15 | - ) ); |
|
| 15 | + )); |
|
| 16 | 16 | |
| 17 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 17 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 18 | 18 | |
| 19 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 20 | - $crawler = $client->click( $link ); |
|
| 19 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 20 | + $crawler = $client->click($link); |
|
| 21 | 21 | |
| 22 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 23 | - $crawler = $client->submit( $form ); |
|
| 22 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 23 | + $crawler = $client->submit($form); |
|
| 24 | 24 | |
| 25 | - $link = $crawler->filter( '.basket-standard .btn-action' )->link(); |
|
| 26 | - $crawler = $client->click( $link ); |
|
| 25 | + $link = $crawler->filter('.basket-standard .btn-action')->link(); |
|
| 26 | + $crawler = $client->click($link); |
|
| 27 | 27 | |
| 28 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Adresse")' )->count() ); |
|
| 29 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() ); |
|
| 30 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .address a' )->count() ); |
|
| 31 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() ); |
|
| 32 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() ); |
|
| 33 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() ); |
|
| 28 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Adresse")')->count()); |
|
| 29 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count()); |
|
| 30 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .address a')->count()); |
|
| 31 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count()); |
|
| 32 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count()); |
|
| 33 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count()); |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 37 | - $form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) ); |
|
| 38 | - $crawler = $client->submit( $form ); |
|
| 36 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 37 | + $form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value')); |
|
| 38 | + $crawler = $client->submit($form); |
|
| 39 | 39 | |
| 40 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() ); |
|
| 41 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() ); |
|
| 42 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Versand")' )->count() ); |
|
| 43 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() ); |
|
| 44 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() ); |
|
| 45 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() ); |
|
| 40 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count()); |
|
| 41 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count()); |
|
| 42 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Versand")')->count()); |
|
| 43 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count()); |
|
| 44 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count()); |
|
| 45 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count()); |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 49 | - $form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) ); |
|
| 50 | - $crawler = $client->submit( $form ); |
|
| 48 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 49 | + $form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value')); |
|
| 50 | + $crawler = $client->submit($form); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() ); |
|
| 53 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() ); |
|
| 54 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() ); |
|
| 55 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Zahlung")' )->count() ); |
|
| 56 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() ); |
|
| 57 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() ); |
|
| 52 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count()); |
|
| 53 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count()); |
|
| 54 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count()); |
|
| 55 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Zahlung")')->count()); |
|
| 56 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count()); |
|
| 57 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count()); |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 61 | - $form['c_paymentoption']->select( $crawler->filter( '.checkout-standard-payment .item-service input' )->attr( 'value' ) ); |
|
| 62 | - $crawler = $client->submit( $form ); |
|
| 60 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 61 | + $form['c_paymentoption']->select($crawler->filter('.checkout-standard-payment .item-service input')->attr('value')); |
|
| 62 | + $crawler = $client->submit($form); |
|
| 63 | 63 | |
| 64 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() ); |
|
| 65 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() ); |
|
| 66 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() ); |
|
| 67 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .payment a' )->count() ); |
|
| 68 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Übersicht")' )->count() ); |
|
| 69 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() ); |
|
| 64 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count()); |
|
| 65 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count()); |
|
| 66 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count()); |
|
| 67 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .payment a')->count()); |
|
| 68 | + $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Übersicht")')->count()); |
|
| 69 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count()); |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | - $link = $crawler->filter( '.checkout-standard .steps .basket a' )->link(); |
|
| 73 | - $crawler = $client->click( $link ); |
|
| 74 | - $this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps' )->count() ); |
|
| 72 | + $link = $crawler->filter('.checkout-standard .steps .basket a')->link(); |
|
| 73 | + $crawler = $client->click($link); |
|
| 74 | + $this->assertEquals(0, $crawler->filter('.checkout-standard .steps')->count()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -80,47 +80,47 @@ discard block |
||
| 80 | 80 | $client = static::createClient(array(), array( |
| 81 | 81 | 'PHP_AUTH_USER' => 'UTC001', |
| 82 | 82 | 'PHP_AUTH_PW' => 'unittest', |
| 83 | - ) ); |
|
| 83 | + )); |
|
| 84 | 84 | |
| 85 | - $crawler = $this->_goToSummary( $client ); |
|
| 85 | + $crawler = $this->_goToSummary($client); |
|
| 86 | 86 | |
| 87 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 87 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | - $link = $crawler->filter( '.checkout-standard .btn-back' )->link(); |
|
| 91 | - $crawler = $client->click( $link ); |
|
| 90 | + $link = $crawler->filter('.checkout-standard .btn-back')->link(); |
|
| 91 | + $crawler = $client->click($link); |
|
| 92 | 92 | |
| 93 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() ); |
|
| 93 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count()); |
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | - $link = $crawler->filter( '.checkout-standard .btn-back' )->link(); |
|
| 97 | - $crawler = $client->click( $link ); |
|
| 96 | + $link = $crawler->filter('.checkout-standard .btn-back')->link(); |
|
| 97 | + $crawler = $client->click($link); |
|
| 98 | 98 | |
| 99 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() ); |
|
| 99 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count()); |
|
| 100 | 100 | |
| 101 | 101 | |
| 102 | - $link = $crawler->filter( '.checkout-standard .btn-back' )->link(); |
|
| 103 | - $crawler = $client->click( $link ); |
|
| 102 | + $link = $crawler->filter('.checkout-standard .btn-back')->link(); |
|
| 103 | + $crawler = $client->click($link); |
|
| 104 | 104 | |
| 105 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() ); |
|
| 105 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count()); |
|
| 106 | 106 | |
| 107 | 107 | |
| 108 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 109 | - $crawler = $client->submit( $form ); |
|
| 108 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 109 | + $crawler = $client->submit($form); |
|
| 110 | 110 | |
| 111 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() ); |
|
| 111 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count()); |
|
| 112 | 112 | |
| 113 | 113 | |
| 114 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 115 | - $crawler = $client->submit( $form ); |
|
| 114 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 115 | + $crawler = $client->submit($form); |
|
| 116 | 116 | |
| 117 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() ); |
|
| 117 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count()); |
|
| 118 | 118 | |
| 119 | 119 | |
| 120 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 121 | - $crawler = $client->submit( $form ); |
|
| 120 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 121 | + $crawler = $client->submit($form); |
|
| 122 | 122 | |
| 123 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 123 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -129,17 +129,17 @@ discard block |
||
| 129 | 129 | $client = static::createClient(array(), array( |
| 130 | 130 | 'PHP_AUTH_USER' => 'UTC001', |
| 131 | 131 | 'PHP_AUTH_PW' => 'unittest', |
| 132 | - ) ); |
|
| 132 | + )); |
|
| 133 | 133 | |
| 134 | - $crawler = $this->_goToSummary( $client ); |
|
| 134 | + $crawler = $this->_goToSummary($client); |
|
| 135 | 135 | |
| 136 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 136 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 137 | 137 | |
| 138 | 138 | |
| 139 | - $link = $crawler->filter( '.checkout-standard .common-summary-address .payment .modify' )->link(); |
|
| 140 | - $crawler = $client->click( $link ); |
|
| 139 | + $link = $crawler->filter('.checkout-standard .common-summary-address .payment .modify')->link(); |
|
| 140 | + $crawler = $client->click($link); |
|
| 141 | 141 | |
| 142 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() ); |
|
| 142 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count()); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
@@ -148,17 +148,17 @@ discard block |
||
| 148 | 148 | $client = static::createClient(array(), array( |
| 149 | 149 | 'PHP_AUTH_USER' => 'UTC001', |
| 150 | 150 | 'PHP_AUTH_PW' => 'unittest', |
| 151 | - ) ); |
|
| 151 | + )); |
|
| 152 | 152 | |
| 153 | - $crawler = $this->_goToSummary( $client ); |
|
| 153 | + $crawler = $this->_goToSummary($client); |
|
| 154 | 154 | |
| 155 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 155 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 156 | 156 | |
| 157 | 157 | |
| 158 | - $link = $crawler->filter( '.checkout-standard .common-summary-address .delivery .modify' )->link(); |
|
| 159 | - $crawler = $client->click( $link ); |
|
| 158 | + $link = $crawler->filter('.checkout-standard .common-summary-address .delivery .modify')->link(); |
|
| 159 | + $crawler = $client->click($link); |
|
| 160 | 160 | |
| 161 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() ); |
|
| 161 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count()); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
@@ -167,17 +167,17 @@ discard block |
||
| 167 | 167 | $client = static::createClient(array(), array( |
| 168 | 168 | 'PHP_AUTH_USER' => 'UTC001', |
| 169 | 169 | 'PHP_AUTH_PW' => 'unittest', |
| 170 | - ) ); |
|
| 170 | + )); |
|
| 171 | 171 | |
| 172 | - $crawler = $this->_goToSummary( $client ); |
|
| 172 | + $crawler = $this->_goToSummary($client); |
|
| 173 | 173 | |
| 174 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 174 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 175 | 175 | |
| 176 | 176 | |
| 177 | - $link = $crawler->filter( '.checkout-standard .common-summary-service .delivery .modify' )->link(); |
|
| 178 | - $crawler = $client->click( $link ); |
|
| 177 | + $link = $crawler->filter('.checkout-standard .common-summary-service .delivery .modify')->link(); |
|
| 178 | + $crawler = $client->click($link); |
|
| 179 | 179 | |
| 180 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() ); |
|
| 180 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count()); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
@@ -186,17 +186,17 @@ discard block |
||
| 186 | 186 | $client = static::createClient(array(), array( |
| 187 | 187 | 'PHP_AUTH_USER' => 'UTC001', |
| 188 | 188 | 'PHP_AUTH_PW' => 'unittest', |
| 189 | - ) ); |
|
| 189 | + )); |
|
| 190 | 190 | |
| 191 | - $crawler = $this->_goToSummary( $client ); |
|
| 191 | + $crawler = $this->_goToSummary($client); |
|
| 192 | 192 | |
| 193 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 193 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 194 | 194 | |
| 195 | 195 | |
| 196 | - $link = $crawler->filter( '.checkout-standard .common-summary-service .payment .modify' )->link(); |
|
| 197 | - $crawler = $client->click( $link ); |
|
| 196 | + $link = $crawler->filter('.checkout-standard .common-summary-service .payment .modify')->link(); |
|
| 197 | + $crawler = $client->click($link); |
|
| 198 | 198 | |
| 199 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() ); |
|
| 199 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count()); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -205,17 +205,17 @@ discard block |
||
| 205 | 205 | $client = static::createClient(array(), array( |
| 206 | 206 | 'PHP_AUTH_USER' => 'UTC001', |
| 207 | 207 | 'PHP_AUTH_PW' => 'unittest', |
| 208 | - ) ); |
|
| 208 | + )); |
|
| 209 | 209 | |
| 210 | - $crawler = $this->_goToSummary( $client ); |
|
| 210 | + $crawler = $this->_goToSummary($client); |
|
| 211 | 211 | |
| 212 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 212 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 213 | 213 | |
| 214 | 214 | |
| 215 | - $link = $crawler->filter( '.checkout-standard .common-summary-detail .modify' )->link(); |
|
| 216 | - $crawler = $client->click( $link ); |
|
| 215 | + $link = $crawler->filter('.checkout-standard .common-summary-detail .modify')->link(); |
|
| 216 | + $crawler = $client->click($link); |
|
| 217 | 217 | |
| 218 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() ); |
|
| 218 | + $this->assertEquals(1, $crawler->filter('.basket-standard')->count()); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -224,51 +224,51 @@ discard block |
||
| 224 | 224 | $client = static::createClient(array(), array( |
| 225 | 225 | 'PHP_AUTH_USER' => 'UTC001', |
| 226 | 226 | 'PHP_AUTH_PW' => 'unittest', |
| 227 | - ) ); |
|
| 227 | + )); |
|
| 228 | 228 | |
| 229 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 229 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 230 | 230 | |
| 231 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 232 | - $crawler = $client->click( $link ); |
|
| 231 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 232 | + $crawler = $client->click($link); |
|
| 233 | 233 | |
| 234 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 235 | - $crawler = $client->submit( $form ); |
|
| 234 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 235 | + $crawler = $client->submit($form); |
|
| 236 | 236 | |
| 237 | - $link = $crawler->filter( '.basket-standard .btn-action' )->link(); |
|
| 238 | - $crawler = $client->click( $link ); |
|
| 237 | + $link = $crawler->filter('.basket-standard .btn-action')->link(); |
|
| 238 | + $crawler = $client->click($link); |
|
| 239 | 239 | |
| 240 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 241 | - $form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) ); |
|
| 242 | - $crawler = $client->submit( $form ); |
|
| 240 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 241 | + $form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value')); |
|
| 242 | + $crawler = $client->submit($form); |
|
| 243 | 243 | |
| 244 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 245 | - $form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) ); |
|
| 246 | - $crawler = $client->submit( $form ); |
|
| 244 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 245 | + $form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value')); |
|
| 246 | + $crawler = $client->submit($form); |
|
| 247 | 247 | |
| 248 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 249 | - $payId = $crawler->filter( '.checkout-standard-payment .item-service' )->eq( 1 )->filter( 'input' )->attr( 'value' ); |
|
| 250 | - $form['c_paymentoption']->select( $payId ); |
|
| 251 | - $form['c_payment[' . $payId . '][directdebit.accountowner]'] = 'test user'; |
|
| 252 | - $form['c_payment[' . $payId . '][directdebit.accountno]'] = '12345'; |
|
| 253 | - $form['c_payment[' . $payId . '][directdebit.bankcode]'] = '67890'; |
|
| 254 | - $form['c_payment[' . $payId . '][directdebit.bankname]'] = 'test bank'; |
|
| 255 | - $crawler = $client->submit( $form ); |
|
| 248 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 249 | + $payId = $crawler->filter('.checkout-standard-payment .item-service')->eq(1)->filter('input')->attr('value'); |
|
| 250 | + $form['c_paymentoption']->select($payId); |
|
| 251 | + $form['c_payment['.$payId.'][directdebit.accountowner]'] = 'test user'; |
|
| 252 | + $form['c_payment['.$payId.'][directdebit.accountno]'] = '12345'; |
|
| 253 | + $form['c_payment['.$payId.'][directdebit.bankcode]'] = '67890'; |
|
| 254 | + $form['c_payment['.$payId.'][directdebit.bankname]'] = 'test bank'; |
|
| 255 | + $crawler = $client->submit($form); |
|
| 256 | 256 | |
| 257 | - $this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() ); |
|
| 257 | + $this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count()); |
|
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | // Test if T&C are not accepted |
| 261 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 262 | - $crawler = $client->submit( $form ); |
|
| 261 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 262 | + $crawler = $client->submit($form); |
|
| 263 | 263 | |
| 264 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 264 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 265 | 265 | $form['cs_option_terms_value']->tick(); |
| 266 | - $crawler = $client->submit( $form ); |
|
| 266 | + $crawler = $client->submit($form); |
|
| 267 | 267 | |
| 268 | - $form = $crawler->filter( '.checkout-standard .btn-action' )->form(); |
|
| 269 | - $crawler = $client->submit( $form ); |
|
| 268 | + $form = $crawler->filter('.checkout-standard .btn-action')->form(); |
|
| 269 | + $crawler = $client->submit($form); |
|
| 270 | 270 | |
| 271 | - $this->assertEquals( 1, $crawler->filter( '.checkout-confirm' )->count() ); |
|
| 271 | + $this->assertEquals(1, $crawler->filter('.checkout-confirm')->count()); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | |
@@ -276,48 +276,48 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | $client = static::createClient(); |
| 278 | 278 | |
| 279 | - $client->request( 'GET', '/unittest/de/EUR/update' ); |
|
| 279 | + $client->request('GET', '/unittest/de/EUR/update'); |
|
| 280 | 280 | |
| 281 | - $this->assertEquals( 200, $client->getResponse()->getStatusCode() ); |
|
| 281 | + $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | |
| 285 | 285 | public function testConfirmComponent() |
| 286 | 286 | { |
| 287 | - $mock = $this->getMockBuilder( 'Aimeos\ShopBundle\Controller\CheckoutController' ) |
|
| 288 | - ->setMethods( array( 'getOutput' ) ) |
|
| 287 | + $mock = $this->getMockBuilder('Aimeos\ShopBundle\Controller\CheckoutController') |
|
| 288 | + ->setMethods(array('getOutput')) |
|
| 289 | 289 | ->disableOriginalConstructor() |
| 290 | 290 | ->getMock(); |
| 291 | 291 | |
| 292 | - $mock->expects( $this->once() )->method( 'getOutput' )->will( $this->returnValue( 'test' ) ); |
|
| 292 | + $mock->expects($this->once())->method('getOutput')->will($this->returnValue('test')); |
|
| 293 | 293 | |
| 294 | - $this->assertEquals( 'test', $mock->confirmComponentAction() ); |
|
| 294 | + $this->assertEquals('test', $mock->confirmComponentAction()); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
| 298 | 298 | public function testStandardComponent() |
| 299 | 299 | { |
| 300 | - $mock = $this->getMockBuilder( 'Aimeos\ShopBundle\Controller\CheckoutController' ) |
|
| 301 | - ->setMethods( array( 'getOutput' ) ) |
|
| 300 | + $mock = $this->getMockBuilder('Aimeos\ShopBundle\Controller\CheckoutController') |
|
| 301 | + ->setMethods(array('getOutput')) |
|
| 302 | 302 | ->disableOriginalConstructor() |
| 303 | 303 | ->getMock(); |
| 304 | 304 | |
| 305 | - $mock->expects( $this->once() )->method( 'getOutput' )->will( $this->returnValue( 'test' ) ); |
|
| 305 | + $mock->expects($this->once())->method('getOutput')->will($this->returnValue('test')); |
|
| 306 | 306 | |
| 307 | - $this->assertEquals( 'test', $mock->standardComponentAction() ); |
|
| 307 | + $this->assertEquals('test', $mock->standardComponentAction()); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | |
| 311 | 311 | public function testUpdateComponent() |
| 312 | 312 | { |
| 313 | - $mock = $this->getMockBuilder( 'Aimeos\ShopBundle\Controller\CheckoutController' ) |
|
| 314 | - ->setMethods( array( 'getOutput' ) ) |
|
| 313 | + $mock = $this->getMockBuilder('Aimeos\ShopBundle\Controller\CheckoutController') |
|
| 314 | + ->setMethods(array('getOutput')) |
|
| 315 | 315 | ->disableOriginalConstructor() |
| 316 | 316 | ->getMock(); |
| 317 | 317 | |
| 318 | - $mock->expects( $this->once() )->method( 'getOutput' )->will( $this->returnValue( 'test' ) ); |
|
| 318 | + $mock->expects($this->once())->method('getOutput')->will($this->returnValue('test')); |
|
| 319 | 319 | |
| 320 | - $this->assertEquals( 'test', $mock->updateComponentAction() ); |
|
| 320 | + $this->assertEquals('test', $mock->updateComponentAction()); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | |
@@ -327,30 +327,30 @@ discard block |
||
| 327 | 327 | * @param \Symfony\Bundle\FrameworkBundle\Client $client HTTP test client |
| 328 | 328 | * @return \Symfony\Component\DomCrawler\Crawler Crawler HTTP crawler |
| 329 | 329 | */ |
| 330 | - protected function _goToSummary( $client ) |
|
| 330 | + protected function _goToSummary($client) |
|
| 331 | 331 | { |
| 332 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 332 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 333 | 333 | |
| 334 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 335 | - $crawler = $client->click( $link ); |
|
| 334 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 335 | + $crawler = $client->click($link); |
|
| 336 | 336 | |
| 337 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 338 | - $crawler = $client->submit( $form ); |
|
| 337 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 338 | + $crawler = $client->submit($form); |
|
| 339 | 339 | |
| 340 | - $link = $crawler->filter( '.basket-standard .btn-action' )->link(); |
|
| 341 | - $crawler = $client->click( $link ); |
|
| 340 | + $link = $crawler->filter('.basket-standard .btn-action')->link(); |
|
| 341 | + $crawler = $client->click($link); |
|
| 342 | 342 | |
| 343 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 344 | - $form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) ); |
|
| 345 | - $crawler = $client->submit( $form ); |
|
| 343 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 344 | + $form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value')); |
|
| 345 | + $crawler = $client->submit($form); |
|
| 346 | 346 | |
| 347 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 348 | - $form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) ); |
|
| 349 | - $crawler = $client->submit( $form ); |
|
| 347 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 348 | + $form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value')); |
|
| 349 | + $crawler = $client->submit($form); |
|
| 350 | 350 | |
| 351 | - $form = $crawler->filter( '.checkout-standard form' )->form(); |
|
| 352 | - $form['c_paymentoption']->select( $crawler->filter( '.checkout-standard-payment .item-service input' )->attr( 'value' ) ); |
|
| 353 | - $crawler = $client->submit( $form ); |
|
| 351 | + $form = $crawler->filter('.checkout-standard form')->form(); |
|
| 352 | + $form['c_paymentoption']->select($crawler->filter('.checkout-standard-payment .item-service input')->attr('value')); |
|
| 353 | + $crawler = $client->submit($form); |
|
| 354 | 354 | |
| 355 | 355 | return $crawler; |
| 356 | 356 | } |
@@ -9,13 +9,13 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public function testSelectComponent() |
| 11 | 11 | { |
| 12 | - $mock = $this->getMockBuilder( 'Aimeos\ShopBundle\Controller\LocaleController' ) |
|
| 13 | - ->setMethods( array( 'getOutput' ) ) |
|
| 12 | + $mock = $this->getMockBuilder('Aimeos\ShopBundle\Controller\LocaleController') |
|
| 13 | + ->setMethods(array('getOutput')) |
|
| 14 | 14 | ->disableOriginalConstructor() |
| 15 | 15 | ->getMock(); |
| 16 | 16 | |
| 17 | - $mock->expects( $this->once() )->method( 'getOutput' )->will( $this->returnValue( 'test' ) ); |
|
| 17 | + $mock->expects($this->once())->method('getOutput')->will($this->returnValue('test')); |
|
| 18 | 18 | |
| 19 | - $this->assertEquals( 'test', $mock->selectComponentAction() ); |
|
| 19 | + $this->assertEquals('test', $mock->selectComponentAction()); |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function indexAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'basket-index' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Basket:index.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('basket-index'); |
|
| 32 | + return $this->render('AimeosShopBundle:Basket:index.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function miniComponentAction() |
| 41 | 41 | { |
| 42 | - return $this->getOutput( 'basket/mini' ); |
|
| 42 | + return $this->getOutput('basket/mini'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function relatedComponentAction() |
| 52 | 52 | { |
| 53 | - return $this->getOutput( 'basket/related' ); |
|
| 53 | + return $this->getOutput('basket/related'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
@@ -61,6 +61,6 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function standardComponentAction() |
| 63 | 63 | { |
| 64 | - return $this->getOutput( 'basket/standard' ); |
|
| 64 | + return $this->getOutput('basket/standard'); |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function confirmAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-confirm' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Checkout:confirm.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('checkout-confirm'); |
|
| 32 | + return $this->render('AimeosShopBundle:Checkout:confirm.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function indexAction() |
| 42 | 42 | { |
| 43 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-index' ); |
|
| 44 | - return $this->render( 'AimeosShopBundle:Checkout:index.html.twig', $params ); |
|
| 43 | + $params = $this->get('aimeos_page')->getSections('checkout-index'); |
|
| 44 | + return $this->render('AimeosShopBundle:Checkout:index.html.twig', $params); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function updateAction() |
| 54 | 54 | { |
| 55 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-update' ); |
|
| 56 | - return $this->render( 'AimeosShopBundle:Checkout:update.html.twig', $params ); |
|
| 55 | + $params = $this->get('aimeos_page')->getSections('checkout-update'); |
|
| 56 | + return $this->render('AimeosShopBundle:Checkout:update.html.twig', $params); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function confirmComponentAction() |
| 66 | 66 | { |
| 67 | - return $this->getOutput( 'checkout/confirm' ); |
|
| 67 | + return $this->getOutput('checkout/confirm'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function standardComponentAction() |
| 77 | 77 | { |
| 78 | - return $this->getOutput( 'checkout/standard' ); |
|
| 78 | + return $this->getOutput('checkout/standard'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
@@ -86,6 +86,6 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function updateComponentAction() |
| 88 | 88 | { |
| 89 | - return $this->getOutput( 'checkout/update' ); |
|
| 89 | + return $this->getOutput('checkout/update'); |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function selectComponentAction() |
| 30 | 30 | { |
| 31 | - return $this->getOutput( 'locale/select' ); |
|
| 31 | + return $this->getOutput('locale/select'); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function countAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-count' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Catalog:count.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('catalog-count'); |
|
| 32 | + return $this->render('AimeosShopBundle:Catalog:count.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function detailAction() |
| 42 | 42 | { |
| 43 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-detail' ); |
|
| 44 | - return $this->render( 'AimeosShopBundle:Catalog:detail.html.twig', $params ); |
|
| 43 | + $params = $this->get('aimeos_page')->getSections('catalog-detail'); |
|
| 44 | + return $this->render('AimeosShopBundle:Catalog:detail.html.twig', $params); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function listAction() |
| 54 | 54 | { |
| 55 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-list' ); |
|
| 56 | - return $this->render( 'AimeosShopBundle:Catalog:list.html.twig', $params ); |
|
| 55 | + $params = $this->get('aimeos_page')->getSections('catalog-list'); |
|
| 56 | + return $this->render('AimeosShopBundle:Catalog:list.html.twig', $params); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function stockAction() |
| 66 | 66 | { |
| 67 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-stock' ); |
|
| 68 | - return $this->render( 'AimeosShopBundle:Catalog:stock.html.twig', $params ); |
|
| 67 | + $params = $this->get('aimeos_page')->getSections('catalog-stock'); |
|
| 68 | + return $this->render('AimeosShopBundle:Catalog:stock.html.twig', $params); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function suggestAction() |
| 78 | 78 | { |
| 79 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-suggest' ); |
|
| 80 | - return $this->render( 'AimeosShopBundle:Catalog:suggest.html.twig', $params ); |
|
| 79 | + $params = $this->get('aimeos_page')->getSections('catalog-suggest'); |
|
| 80 | + return $this->render('AimeosShopBundle:Catalog:suggest.html.twig', $params); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function countComponentAction() |
| 90 | 90 | { |
| 91 | - return $this->getOutput( 'catalog/count' ); |
|
| 91 | + return $this->getOutput('catalog/count'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function detailComponentAction() |
| 101 | 101 | { |
| 102 | - return $this->getOutput( 'catalog/detail' ); |
|
| 102 | + return $this->getOutput('catalog/detail'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function filterComponentAction() |
| 112 | 112 | { |
| 113 | - return $this->getOutput( 'catalog/filter' ); |
|
| 113 | + return $this->getOutput('catalog/filter'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function listComponentAction() |
| 123 | 123 | { |
| 124 | - return $this->getOutput( 'catalog/lists' ); |
|
| 124 | + return $this->getOutput('catalog/lists'); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function sessionComponentAction() |
| 134 | 134 | { |
| 135 | - return $this->getOutput( 'catalog/session' ); |
|
| 135 | + return $this->getOutput('catalog/session'); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function stageComponentAction() |
| 145 | 145 | { |
| 146 | - return $this->getOutput( 'catalog/stage' ); |
|
| 146 | + return $this->getOutput('catalog/stage'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function stockComponentAction() |
| 156 | 156 | { |
| 157 | - return $this->getOutput( 'catalog/stock' ); |
|
| 157 | + return $this->getOutput('catalog/stock'); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
@@ -165,6 +165,6 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function suggestComponentAction() |
| 167 | 167 | { |
| 168 | - return $this->getOutput( 'catalog/suggest' ); |
|
| 168 | + return $this->getOutput('catalog/suggest'); |
|
| 169 | 169 | } |
| 170 | 170 | } |