mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-22 20:46:03 +03:00
1a71c14097
* Removed inheritence, Renamed classes, Mark all classes as final * code style * Updated docs * Code style * Be consistant with the naming of functions * Fixed tests
67 lines
1.4 KiB
PHP
67 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Mailgun\Tests\Api;
|
|
|
|
use GuzzleHttp\Psr7\Response;
|
|
|
|
/**
|
|
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
|
*/
|
|
class StatsTest extends TestCase
|
|
{
|
|
protected function getApiClass()
|
|
{
|
|
return 'Mailgun\Api\Stats';
|
|
}
|
|
|
|
public function testTotal()
|
|
{
|
|
$data = [
|
|
'foo' => 'bar',
|
|
];
|
|
|
|
$api = $this->getApiMock();
|
|
$api->expects($this->once())
|
|
->method('httpGet')
|
|
->with('/v3/domain/stats/total', $data)
|
|
->willReturn(new Response());
|
|
|
|
$api->total('domain', $data);
|
|
}
|
|
|
|
// /**
|
|
// * @expectedException \Mailgun\Exception\InvalidArgumentException
|
|
// */
|
|
// public function testTotalInvalidArgument()
|
|
// {
|
|
// $api = $this->getApiMock();
|
|
//
|
|
// $api->total('');
|
|
// }
|
|
|
|
public function testAll()
|
|
{
|
|
$data = [
|
|
'foo' => 'bar',
|
|
];
|
|
|
|
$api = $this->getApiMock();
|
|
$api->expects($this->once())
|
|
->method('httpGet')
|
|
->with('/v3/domain/stats', $data)
|
|
->willReturn(new Response());
|
|
|
|
$api->all('domain', $data);
|
|
}
|
|
|
|
// /**
|
|
// * @expectedException \Mailgun\Exception\InvalidArgumentException
|
|
// */
|
|
// public function testAllInvalidArgument()
|
|
// {
|
|
// $api = $this->getApiMock();
|
|
//
|
|
// $api->all('');
|
|
// }
|
|
}
|