Updated to use Assert 1.2 (#224)

This commit is contained in:
Tobias Nyholm 2016-11-23 23:01:26 +01:00 committed by GitHub
parent a3e999e875
commit 8668b4c222
3 changed files with 27 additions and 21 deletions

View File

@ -8,7 +8,7 @@
"php-http/message": "^1.0",
"php-http/client-common": "^1.0",
"php-http/discovery": "^1.0",
"webmozart/assert": "^1.1"
"webmozart/assert": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.8",

View File

@ -1,5 +1,12 @@
<?php
/*
* Copyright (C) 2013-2016 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Mailgun;
use Mailgun\Exception\InvalidArgumentException;
@ -11,8 +18,8 @@ use Mailgun\Exception\InvalidArgumentException;
*/
class Assert extends \Webmozart\Assert\Assert
{
protected static function createInvalidArgumentException($message)
protected static function reportInvalidArgument($message)
{
return new InvalidArgumentException($message);
throw new InvalidArgumentException($message);
}
}

View File

@ -29,15 +29,14 @@ class StatsTest extends TestCase
$api->total('domain', $data);
}
// /**
// * @expectedException \Mailgun\Exception\InvalidArgumentException
// */
// public function testTotalInvalidArgument()
// {
// $api = $this->getApiMock();
//
// $api->total('');
// }
/**
* @expectedException \Mailgun\Exception\InvalidArgumentException
*/
public function testTotalInvalidArgument()
{
$api = $this->getApiMock();
$api->total('');
}
public function testAll()
{
@ -54,13 +53,13 @@ class StatsTest extends TestCase
$api->all('domain', $data);
}
// /**
// * @expectedException \Mailgun\Exception\InvalidArgumentException
// */
// public function testAllInvalidArgument()
// {
// $api = $this->getApiMock();
//
// $api->all('');
// }
/**
* @expectedException \Mailgun\Exception\InvalidArgumentException
*/
public function testAllInvalidArgument()
{
$api = $this->getApiMock();
$api->all('');
}
}