/** * Test setting the storage name returns instance of Mic2100\IsTor\Assessor */ public function test_set_storage_name() { $storage = $this->mockStorage(); $storage->expects($this->once())->method('setName')->will($this->returnSelf()); $assessor = new Assessor($this->mockEngine(), $storage); $this->assertInstanceOf('Mic2100\\IsTor\\Assessor', $assessor->setStorageName(__DIR__ . '/ips.ip')); }
public function testIsTor() { $filename = sys_get_temp_dir() . '/ips.ip'; $ip = '86.19.228.173'; $storage = new FileStorage(); $engine = new Engine(); $subscriptions = new Subscriptions($engine, $storage); $assessor = new Assessor($engine, $storage); $subscriptions->addSubscription(new Tor($ip))->setName($filename)->retrieve(); if ($assessor->setStorageName($filename)->isTor($ip)) { $this->assertTrue(true); } $this->assertTrue(true); }