예제 #1
0
파일: Persistent.php 프로젝트: vgrish/tacit
 /**
  * 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;
     }
 }
예제 #2
0
파일: TacitTest.php 프로젝트: vgrish/tacit
 /**
  * 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');
 }
예제 #3
0
파일: HMACTest.php 프로젝트: vgrish/tacit
 /**
  * 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));
 }