コード例 #1
0
 public function testGetProviderFallbackToDefault()
 {
     $provider = $this->getProviderMock();
     // Register default provider:
     $provider->expects($this->any())->method('getNamespace')->will($this->returnValue('default'));
     $settings = new Settings();
     $settings->addProvider($provider);
     // Now. try to get provider null
     $this->assertSame($provider, $settings->getProvider(null));
 }
コード例 #2
0
ファイル: SettingsTest.php プロジェクト: wotek/settings
 public function testRuntimeExeptionWhenNoResolverFound()
 {
     $this->setExpectedException('RuntimeException');
     $settings = new Settings();
     $settings->addProvider(new Blackhole());
     $settings->get('
         this_should_throw_exception
         _couse_no_resolver_was_attached_to_object');
 }