/**
  * @test
  */
 public function shouldAddEmptyPrimaryKeyEntryWhenNoFoundPrimaryKeyInTable()
 {
     //given
     /** @var Dialect $dialect */
     $dialect = Mock::mock('Ouzo\\Tools\\Model\\Template\\Dialect\\Dialect');
     Mock::when($dialect)->primaryKey()->thenReturn('');
     Mock::when($dialect)->columns()->thenReturn(array());
     $classStubReplacer = new ClassStubPlaceholderReplacer('Customer', new TableInfo($dialect));
     //when
     $classContents = $classStubReplacer->contents();
     //then
     Assert::thatString($classContents)->isNotEqualTo('')->contains('primaryKey');
 }
Example #2
0
 public function templateContents()
 {
     $tableInfo = new TableInfo($this->adapter);
     $stubReplacer = new ClassStubPlaceholderReplacer($this->getTemplateClassName(), $tableInfo, $this->getClassNamespace(), $this->shortArrays);
     return $stubReplacer->contents();
 }