Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Feb 8, 2019
1 parent 123f24c commit aebb1d8
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions tests/Support/SupportHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,53 +922,47 @@ public function testWith()

public function testEnv()
{
putenv('foo=bar');
$this->assertEquals('bar', env('foo'));
}

public function testEnvWithQuotes()
{
putenv('foo="bar"');
$this->assertEquals('bar', env('foo'));
$_SERVER['foo'] = 'bar';
$this->assertSame('bar', env('foo'));
}

public function testEnvTrue()
{
putenv('foo=true');
$_SERVER['foo'] = 'true';
$this->assertTrue(env('foo'));

putenv('foo=(true)');
$_SERVER['foo'] = '(true)';
$this->assertTrue(env('foo'));
}

public function testEnvFalse()
{
putenv('foo=false');
$_SERVER['foo'] = 'false';
$this->assertFalse(env('foo'));

putenv('foo=(false)');
$_SERVER['foo'] = '(false)';
$this->assertFalse(env('foo'));
}

public function testEnvEmpty()
{
putenv('foo=');
$this->assertEquals('', env('foo'));
$_SERVER['foo'] = '';
$this->assertSame('', env('foo'));

putenv('foo=empty');
$this->assertEquals('', env('foo'));
$_SERVER['foo'] = 'empty';
$this->assertSame('', env('foo'));

putenv('foo=(empty)');
$this->assertEquals('', env('foo'));
$_SERVER['foo'] = '(empty)';
$this->assertSame('', env('foo'));
}

public function testEnvNull()
{
putenv('foo=null');
$this->assertEquals('', env('foo'));
$_SERVER['foo'] = 'null';
$this->assertNull(env('foo'));

putenv('foo=(null)');
$this->assertEquals('', env('foo'));
$_SERVER['foo'] = '(null)';
$this->assertNull(env('foo'));
}
}

Expand Down

0 comments on commit aebb1d8

Please sign in to comment.