From 8bd00943f4f8b1a6c0d1e6835b9803ed3ccf6cf6 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 2 Dec 2013 19:26:20 -0800 Subject: [PATCH] Added tests for accessing unknown attributes --- tests/GeoIp2/Test/Model/CountryTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/GeoIp2/Test/Model/CountryTest.php b/tests/GeoIp2/Test/Model/CountryTest.php index 91c4556..ccfc96a 100644 --- a/tests/GeoIp2/Test/Model/CountryTest.php +++ b/tests/GeoIp2/Test/Model/CountryTest.php @@ -204,6 +204,23 @@ class CountryTest extends \PHPUnit_Framework_TestCase isset($this->model->traits->unknown), 'unknown trait is not set' ); + } + /** + * @expectedException RuntimeException + * @expectedExceptionMessage Unknown attribute + */ + public function testUnknownRecord() + { + $this->model->unknownRecord; + } + + /** + * @expectedException RuntimeException + * @expectedExceptionMessage Unknown attribute + */ + public function testUnknownTrait() + { + $this->model->traits->unknown; } }