Return false instead of null for boolean attributes

This commit is contained in:
Dave Rolsky
2014-10-28 10:27:18 -05:00
parent caf91dd247
commit c44053c276
5 changed files with 32 additions and 6 deletions
+3 -3
View File
@@ -96,9 +96,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$record = $reader->anonymousIp($ipAddress);
$this->assertSame(true, $record->isAnonymous);
$this->assertSame(true, $record->isAnonymousVpn);
$this->assertSame(null, $record->isHostingProvider);
$this->assertSame(null, $record->isPublicProxy);
$this->assertSame(null, $record->isTorExitNode);
$this->assertSame(false, $record->isHostingProvider);
$this->assertSame(false, $record->isPublicProxy);
$this->assertSame(false, $record->isTorExitNode);
$this->assertEquals($ipAddress, $record->ipAddress);
$reader->close();
}
+13 -1
View File
@@ -62,7 +62,7 @@ class InsightsTest extends \PHPUnit_Framework_TestCase
'autonomous_system_organization' => 'AS Organization',
'domain' => 'example.com',
'ip_address' => '1.2.3.4',
'is_satellite_provider' => 1,
'is_satellite_provider' => true,
'isp' => 'Comcast',
'organization' => 'Blorg',
'user_type' => 'college',
@@ -130,6 +130,18 @@ class InsightsTest extends \PHPUnit_Framework_TestCase
'$model->traits'
);
$this->assertSame(
true,
$model->traits->isSatelliteProvider,
'$model->traits->isSatelliteProvider is true'
);
$this->assertSame(
false,
$model->traits->isAnonymousProxy,
'$model->traits->isAnonymousProxy is false'
);
$this->assertEquals(
22,
$model->maxmind->queriesRemaining,