Skip to content

Commit

Permalink
Customers aren't logged in when accounts are newly created during che…
Browse files Browse the repository at this point in the history
…ckout
  • Loading branch information
aimeos committed May 13, 2017
1 parent 7025b5a commit 8722ea4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Expand Up @@ -65,7 +65,7 @@ public function getItem( $id )
$search = $manager->createSearch( true );
$expr = [
$search->compare( '==', 'order.id', $id ),
$search->compare( '==', 'order.base.customerid', (string) $context->getUserId() ),
$search->compare( '==', 'order.editor', $context->getEditor() ),
$search->getConditions(),
];
$search->setConditions( $search->combine( '&&', $expr ) );
Expand Down
Expand Up @@ -60,7 +60,7 @@ public function testGetItem()
$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
$customerItem = $manager->findItem( 'UTC001' );

$this->context->setUserId( $customerItem->getId() );
$this->context->setEditor( 'core:unittest' );

$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
$search = $manager->createSearch()->setSlice( 0, 1 );
Expand All @@ -77,16 +77,8 @@ public function testGetItem()

public function testGetItemException()
{
$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
$search = $manager->createSearch()->setSlice( 0, 1 );
$result = $manager->searchItems( $search );

if( ( $item = reset( $result ) ) === false ) {
throw new \RuntimeException( 'No order item found' );
}

$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
$this->object->getItem( $item->getId() );
$this->object->getItem( -1 );
}


Expand Down

0 comments on commit 8722ea4

Please sign in to comment.