Skip to content

Commit a6b1a07

Browse files
committed
Fix duplicate constant definition
1 parent caf3a8d commit a6b1a07

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

tests/Basic/BasicSchemaGenerationTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ public function testNamespacePrefix(): void
168168

169169
public function testFolderIsGeneratedRecursively(): void
170170
{
171-
define('MODEL_TEMP_PATH', sys_get_temp_dir() . '/PHPModelGeneratorTest/Models');
172-
173171
(new ModelGenerator(
174172
(new GeneratorConfiguration())
175173
->setNamespacePrefix('\\Application')
@@ -249,8 +247,6 @@ public function testIdenticalSchemasAreMappedToOneClass(): void
249247

250248
public function testIdenticalSchemasAreMappedToOneClassFromDifferentNamespaces(): void
251249
{
252-
define('MODEL_TEMP_PATH', sys_get_temp_dir() . '/PHPModelGeneratorTest/Models');
253-
254250
ob_start();
255251

256252
$generatedClasses = (new ModelGenerator(

tests/bootstrap.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
<?php
2-
3-
const FAILED_CLASSES_PATH = __DIR__ . '/../failed-classes/';
4-
5-
if (is_dir(FAILED_CLASSES_PATH)) {
6-
$di = new RecursiveDirectoryIterator(FAILED_CLASSES_PATH, FilesystemIterator::SKIP_DOTS);
7-
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
8-
9-
foreach ($ri as $file) {
10-
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
11-
}
12-
}
13-
14-
@mkdir(FAILED_CLASSES_PATH);
15-
16-
require_once __DIR__ . '/../vendor/autoload.php';
1+
<?php
2+
3+
define('FAILED_CLASSES_PATH', __DIR__ . '/../failed-classes/');
4+
define('MODEL_TEMP_PATH', sys_get_temp_dir() . '/PHPModelGeneratorTest/Models');
5+
6+
if (is_dir(FAILED_CLASSES_PATH)) {
7+
$di = new RecursiveDirectoryIterator(FAILED_CLASSES_PATH, FilesystemIterator::SKIP_DOTS);
8+
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
9+
10+
foreach ($ri as $file) {
11+
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
12+
}
13+
}
14+
15+
@mkdir(FAILED_CLASSES_PATH);
16+
17+
require_once __DIR__ . '/../vendor/autoload.php';

0 commit comments

Comments
 (0)