Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/1.6' into 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Banin committed Aug 14, 2015
2 parents 1be7f4b + 1f31955 commit 0958318
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function getManager()
*/
public function getForm()
{
return $this->get('orocrm_account.form.type.account.api');
return $this->get('orocrm_account.form.account.api');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function getManager()
*/
public function getForm()
{
return $this->get('orocrm_case.form.type.comment.api');
return $this->get('orocrm_case.form.comment.api');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function getMaxDate(array $data)

$result = (empty($maxYear) && empty($maxMonth)) ? 'now' : sprintf('%s-%s', $maxYear, $maxMonth + 1);

return new \DateTime($result);
return new \DateTime($result, new \DateTimeZone('UTC'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ protected function setUp()

protected function postFixtureLoad()
{
$channel = $this->em->getRepository('OroIntegrationBundle:Channel')->findAll();
$channel = reset($channel);
$channel = $this->getReference('default_channel');
if (!$channel) {
$this->markTestIncomplete('Invalid fixtures, unable to perform test case');
}
Expand All @@ -42,17 +41,21 @@ protected function postFixtureLoad()

public function testDeleteChannel()
{
$channel = $this->em->find('OroIntegrationBundle:Channel', self::$channelId);
$channelId = $channel->getId();
$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Cart', $channel));
$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Order', $channel));
$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Website', $channel));
$channel = $this->em->find('OroCRMChannelBundle:Channel', self::$channelId);

$integration = $channel->getDataSource();

$integrationId = $integration->getId();

$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Cart', $integration));
$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Order', $integration));
$this->assertGreaterThan(0, $this->getRecordsCount('OroCRMMagentoBundle:Website', $integration));
$this->client->getKernel()->getContainer()->get('oro_integration.delete_manager')->delete(
$channel
$integration
);
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Cart', $channelId));
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Order', $channelId));
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Website', $channelId));
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Cart', $integrationId));
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Order', $integrationId));
$this->assertEquals(0, $this->getRecordsCount('OroCRMMagentoBundle:Website', $integrationId));
}

/**
Expand Down

0 comments on commit 0958318

Please sign in to comment.