Skip to content

Commit

Permalink
- Removed version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tylernathanreed committed Feb 9, 2022
1 parent da0c1a5 commit 9436207
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions tests/Unit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,14 @@
use Illuminate\Database\Query\Builder as BaseBuilder;
use Illuminate\Database\Query\Grammars\Grammar;
use Illuminate\Database\Query\Processors\Processor;
use Illuminate\Support\Arr;
use Mockery as m;
use PHPUnit\Framework\TestCase as TestBase;
use Reedware\LaravelRelationJoins\LaravelRelationJoinServiceProvider;
use Reedware\LaravelRelationJoins\Tests\CustomBuilder;
use Reedware\LaravelRelationJoins\Tests\Models\EloquentRelationJoinModelStub;
use RuntimeException;

class TestCase extends TestBase
{
/**
* The current laravel version.
*
* @var string
*/
protected $version;

/**
* The mocked database connection.
*
Expand All @@ -42,41 +33,10 @@ protected function setUp(): void
{
parent::setUp();

$this->assignLaravelVersion();
$this->setUpConnectionResolver();
$this->registerServiceProvider();
}

/**
* Locally stores the current laravel version for later comparison.
*
* @return void
*/
protected function assignLaravelVersion(): void
{
$this->version = static::getLaravelVersion();
}

/**
* Returns the current laravel version.
*
* @return string
*
* @throws \RuntimeException
*/
public static function getLaravelVersion(): string
{
$composer = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'));

if (is_null($composer)) {
throw new RuntimeException('Unable to determine Laravel Version.');
}

return substr(Arr::first($composer->packages, function ($package) {
return $package->name == 'illuminate/support';
})->version, 1);
}

/**
* Mocks the connection resolver for testing.
*
Expand Down Expand Up @@ -136,18 +96,6 @@ protected function tearDown(): void
m::close();
}

/**
* Returns whether or not the specified version is after the current version.
*
* @param string $version
*
* @return bool
*/
public function isVersionAfter(string $version): bool
{
return version_compare($this->version, $version) >= 0;
}

/**
* Returns the query resolvers for each test.
*
Expand Down

0 comments on commit 9436207

Please sign in to comment.