prestashop-module/tests/lib/RetailcrmReferencesTest.php

44 lines
1.5 KiB
PHP
Raw Normal View History

2018-05-28 17:09:31 +03:00
<?php
class RetailcrmReferencesTest extends RetailcrmTestCase
{
private $retailcrmReferences;
public function setUp()
{
parent::setUp();
$apiMock = $this->createMock('RetailcrmProxy');
$this->retailcrmReferences = new RetailcrmReferences($apiMock);
$this->retailcrmReferences->getSystemPaymentModules(false);
}
public function testCarriers()
{
$this->assertInternalType('array', $this->retailcrmReferences->carriers);
$this->assertNotEmpty($this->retailcrmReferences->carriers);
$this->assertArrayHasKey('name', $this->retailcrmReferences->carriers[0]);
$this->assertArrayHasKey('id_carrier', $this->retailcrmReferences->carriers[0]);
}
public function testGetSystemPaymentModules()
{
$this->assertInternalType('array', $this->retailcrmReferences->payment_modules);
2018-05-30 09:58:53 +03:00
if (version_compare(_PS_VERSION_, '1.7', '>')) {
$this->assertNotEmpty($this->retailcrmReferences->payment_modules);
$this->assertArrayHasKey('name', $this->retailcrmReferences->payment_modules[0]);
$this->assertArrayHasKey('code', $this->retailcrmReferences->payment_modules[0]);
$this->assertArrayHasKey('id', $this->retailcrmReferences->payment_modules[0]);
}
2018-05-28 17:09:31 +03:00
}
public function testGetStatuses()
{
$statuses = $this->retailcrmReferences->getStatuses();
$this->assertInternalType('array', $statuses);
$this->assertNotEmpty($statuses);
}
}