Esempio n. 1
0
 public function testSetAndGetLogger()
 {
     $key = Registry::LOGGER;
     $object = new \StdClass();
     Registry::set($key, $object);
     $actual = Registry::get($key);
     $this->assertEquals($object, $actual);
     $this->assertInstanceOf('StdClass', $actual);
 }
 public function testSetAndGetLogger()
 {
     Registry::set(Registry::LOGGER, new \StdClass());
     $logger = Registry::get(Registry::LOGGER);
     $this->assertInstanceOf('StdClass', $logger);
 }
 /**
  * notice @runInSeparateProcess here: without it, a previous test might have set it already and
  * testing would not be possible. That's why you should implement Dependency Injection where an
  * injected class may easily be replaced by a mockup
  *
  * @runInSeparateProcess
  * @expectedException \InvalidArgumentException
  */
 public function testThrowsExceptionWhenTryingToGetNotSetKey()
 {
     Registry::get(Registry::LOGGER);
 }