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/message": "^1.0",
"php-http/client-common": "^1.0", "php-http/client-common": "^1.0",
"php-http/discovery": "^1.0", "php-http/discovery": "^1.0",
"webmozart/assert": "^1.1" "webmozart/assert": "^1.2"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.8", "phpunit/phpunit": "~4.8",

View File

@ -1,5 +1,12 @@
<?php <?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; namespace Mailgun;
use Mailgun\Exception\InvalidArgumentException; use Mailgun\Exception\InvalidArgumentException;
@ -11,8 +18,8 @@ use Mailgun\Exception\InvalidArgumentException;
*/ */
class Assert extends \Webmozart\Assert\Assert 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); $api->total('domain', $data);
} }
// /** /**
// * @expectedException \Mailgun\Exception\InvalidArgumentException * @expectedException \Mailgun\Exception\InvalidArgumentException
// */ */
// public function testTotalInvalidArgument() public function testTotalInvalidArgument()
// { {
// $api = $this->getApiMock(); $api = $this->getApiMock();
// $api->total('');
// $api->total(''); }
// }
public function testAll() public function testAll()
{ {
@ -54,13 +53,13 @@ class StatsTest extends TestCase
$api->all('domain', $data); $api->all('domain', $data);
} }
// /** /**
// * @expectedException \Mailgun\Exception\InvalidArgumentException * @expectedException \Mailgun\Exception\InvalidArgumentException
// */ */
// public function testAllInvalidArgument() public function testAllInvalidArgument()
// { {
// $api = $this->getApiMock(); $api = $this->getApiMock();
//
// $api->all(''); $api->all('');
// } }
} }