File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,20 @@ protected function setUp(): void
104
104
//$this->tdbmDaoGenerator->setComposerFile($this->rootPath.'composer.json');
105
105
}
106
106
107
+ public function testGetSchemaCrashWithoutLock ()
108
+ {
109
+ //let's delete the lock file
110
+ $ schemaFilePath = TDBMSchemaAnalyzer::getLockFilePath ();
111
+ if (file_exists ($ schemaFilePath )) {
112
+ unlink ($ schemaFilePath );
113
+ }
114
+ //let's check we cannot call get schema without a lock file
115
+ $ schemaAnalyzer = new SchemaAnalyzer (self ::getConnection ()->getSchemaManager (), new ArrayCache (), 'prefix_ ' );
116
+ $ tdbmSchemaAnalyzer = new TDBMSchemaAnalyzer (self ::getConnection (), new ArrayCache (), $ schemaAnalyzer );
117
+ $ this ->expectException ('TheCodingMachine\TDBM\TDBMException ' );
118
+ $ schema1 = $ tdbmSchemaAnalyzer ->getSchema (true );
119
+ }
120
+
107
121
public function testDaoGeneration (): void
108
122
{
109
123
// Remove all previously generated files.
You can’t perform that action at this time.
0 commit comments