/** * Get a new instance of a Persistent object. * * @param Repository $repository A specific repository for the instance. * * @return Persistent */ public function __construct(Repository $repository = null) { if (null === $repository) { $this->_repository = Tacit::getInstance()->container->get('repository'); } else { $this->_repository = $repository; } }
/** * Test Tacit::getInstance() */ public function testGetInstance() { $tacit = Tacit::getInstance(); $this->assertInstanceOf('Tacit\\Tacit', $tacit, 'Could not get a valid instance of \\Tacit\\Tacit'); $this->assertInstanceOf('Slim\\Slim', $tacit, 'The instance of Tacit instantiated is not an instance of \\Slim\\Slim'); }
/** * Test the static HMAC::identities() method. * * @param array $expected * * @dataProvider providerIdentities */ public function testIdentities($expected) { $tacit = Tacit::getInstance(); $tacit->config('tacit.identitiesFile', __DIR__ . '/../../../identities.php'); $this->assertEquals($expected, (new HMAC())->identities($tacit)); }