Commit 1e75bc46 authored by yosymfony's avatar yosymfony
Browse files

Added some tests in TomBuilderInvalidTest class

parent dcbae341
......@@ -2,8 +2,8 @@ CHANGELOG
=========
1.0.4
-----
* Several corrections in `TomBuilder` class. The problem described in the PR #25 has been solved.
* The test file `TomlBuilderTest` has been refactored for readability.
* Several corrections in `TomBuilder` class. The problem described in the PR #25 "fixed a bug when used the function 'in_array'" has been solved.
* The test file `TomlBuilderTest` has been refactored for readability. Added some tests.
1.0.3 (2018-07-31)
------------------
......
......@@ -50,6 +50,39 @@ class TomlBuilderInvalidTest extends TestCase
$this->builder->addArrayOfTable('');
}
/**
* @expectedException Yosymfony\Toml\Exception\DumpException
* @expectedExceptionMessage A key, table name or array of table name cannot be empty or null.
*/
public function testAddValueMustFailWhenKeyWithJustWhiteSpaces()
{
$whiteSpaceKey = ' ';
$this->builder->addValue($whiteSpaceKey, 'value');
}
/**
* @expectedException Yosymfony\Toml\Exception\DumpException
* @expectedExceptionMessage A key, table name or array of table name cannot be empty or null.
*/
public function testAddTableMustFailWhenKeyWithJustWhiteSpaces()
{
$whiteSpaceKey = ' ';
$this->builder->addTable($whiteSpaceKey);
}
/**
* @expectedException Yosymfony\Toml\Exception\DumpException
* @expectedExceptionMessage A key, table name or array of table name cannot be empty or null.
*/
public function testAddArrayOfTableMustFailWhenKeyWithJustWhiteSpaces()
{
$whiteSpaceKey = ' ';
$this->builder->addArrayOfTable($whiteSpaceKey);
}
/**
* @expectedException Yosymfony\Toml\Exception\DumpException
* @expectedExceptionMessage Data types cannot be mixed in an array. Key: "strings-and-ints".
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment