Skip to content

Commit

Permalink
IHF: Formatted.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Sep 27, 2016
1 parent fece63e commit 82638ce
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/json/IsJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ public function it_returns_false_for_float()
}

/** @test */
public function it_returns_false_for_empty_array()
public function it_returns_false_for_an_empty_string()
{
$this->assertFalse(is_json([]));
$this->assertFalse(is_json(''));
}

/** @test */
public function it_returns_false_for_non_empty_array()
public function it_returns_false_for_non_json_string()
{
$this->assertFalse(is_json(['foo' => 'bar']));
$this->assertFalse(is_json('non-json string'));
}

/** @test */
public function it_returns_false_for_object()
public function it_returns_false_for_empty_array()
{
$this->assertFalse(is_json(new StdClass()));
$this->assertFalse(is_json([]));
}

/** @test */
public function it_returns_false_for_an_empty_string()
public function it_returns_false_for_non_empty_array()
{
$this->assertFalse(is_json(''));
$this->assertFalse(is_json(['foo' => 'bar']));
}

/** @test */
public function it_returns_false_for_non_json_string()
public function it_returns_false_for_object()
{
$this->assertFalse(is_json('non-json string'));
$this->assertFalse(is_json(new StdClass()));
}

/** @test */
Expand Down Expand Up @@ -104,23 +104,23 @@ public function it_returns_true_for_json_encoded_float()
}

/** @test */
public function it_returns_true_for_json_encoded_array()
public function it_returns_true_for_json_encoded_string()
{
$json = json_encode(['foo' => 'bar']);
$json = json_encode('string to encode');
$this->assertTrue(is_json($json));
}

/** @test */
public function it_returns_true_for_json_encoded_object()
public function it_returns_true_for_json_encoded_array()
{
$json = json_encode((object) ['foo' => 'bar', 'baz' => 'bax']);
$json = json_encode(['foo' => 'bar']);
$this->assertTrue(is_json($json));
}

/** @test */
public function it_returns_true_for_json_encoded_string()
public function it_returns_true_for_json_encoded_object()
{
$json = json_encode('string to encode');
$json = json_encode((object) ['foo' => 'bar', 'baz' => 'bax']);
$this->assertTrue(is_json($json));
}

Expand Down

0 comments on commit 82638ce

Please sign in to comment.