コード例 #1
0
ファイル: DaoBuilderContext.php プロジェクト: ritalin/omelet
 public function __construct(Configuration $config)
 {
     $this->config = $config;
     $this->config->validate();
     $this->watcher = new ChangeWatcher($this->config->daoClassPath, WatchMode::{$this->config->watchMode}());
     $this->sequenceManager = new SequenceNameManager();
     $this->registerClassLoader();
 }
コード例 #2
0
 /**
  * @test
  */
 public function test_validate_config_invalid_value()
 {
     watchMode:
     $config = new Configuration();
     $config->watchMode = 'hogeee';
     $results = $config->validate(true);
     $this->assertCount(2, $results);
     $this->assertArrayHasKey('watchMode', $results);
     $this->assertArrayHasKey('connectionString', $results);
     paramCaseSensor:
     $config = new Configuration();
     $config->paramCaseSensor = 'fooooo';
     $results = $config->validate(true);
     $this->assertCount(2, $results);
     $this->assertArrayHasKey('paramCaseSensor', $results);
     $this->assertArrayHasKey('connectionString', $results);
     returnCaseSensor:
     $config = new Configuration();
     $config->returnCaseSensor = 'wooooh';
     $results = $config->validate(true);
     $this->assertCount(2, $results);
     $this->assertArrayHasKey('returnCaseSensor', $results);
     $this->assertArrayHasKey('connectionString', $results);
 }