Skip to content

Commit

Permalink
test: remove version restriction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miclaus committed Jan 3, 2025
1 parent 109f768 commit 1b1ed85
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
15 changes: 0 additions & 15 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,6 @@ protected function configureDefaultDatabaseConnection(string $directory, string
);
}

/**
* Determine if the application is using Laravel 11 or newer.
*
* @param string $directory
* @return bool
*/
public function usingLaravelVersionOrNewer(int $usingVersion, string $directory): bool
{
$version = json_decode(file_get_contents($directory.'/composer.json'), true)['require']['laravel/framework'];
$version = str_replace('^', '', $version);
$version = explode('.', $version)[0];

return $version >= $usingVersion;
}

/**
* Comment the irrelevant database configuration entries for SQLite applications.
*
Expand Down
13 changes: 0 additions & 13 deletions tests/NewCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,4 @@ public function test_it_can_chops_trailing_slash_from_name()
);
}
}

public function test_on_at_least_laravel_11()
{
$command = new NewCommand;

$onLaravel10 = $command->usingLaravelVersionOrNewer(11, __DIR__.'/fixtures/laravel10');
$onLaravel11 = $command->usingLaravelVersionOrNewer(11, __DIR__.'/fixtures/laravel11');
$onLaravel12 = $command->usingLaravelVersionOrNewer(11, __DIR__.'/fixtures/laravel12');

$this->assertFalse($onLaravel10);
$this->assertTrue($onLaravel11);
$this->assertTrue($onLaravel12);
}
}

0 comments on commit 1b1ed85

Please # to comment.