added tests

This commit is contained in:
Jake Mitchell
2016-06-25 22:10:21 +00:00
parent ea3ec0bacc
commit ddea4dd573
5 changed files with 47 additions and 12 deletions

View File

@@ -3,13 +3,31 @@
namespace Glmdev\Meta\Tests;
use Glmdev\Meta\Meta;
use Ramsey\Uuid\Uuid;
class MetaTest extends \PHPUnit_Framework_TestCase
{
// TODO: write tests
public function testItReturnsTrue ()
public function testReadWrite ()
{
$this->assertTrue(true);
$model = Meta::create();
$model->write('name', 'John');
$model->write('age', 15);
$model->write('email', 'Johnny@appleseed.com');
$this->assertEquals('John', $model->read('name'));
$this->assertEquals(15, $model->read('age'));
$this->assertEquals('Johnny@appleseed.com', $model->read('email'));
}
public function testUuid ()
{
$model = Meta::create();
$uuid = Uuid::uuid4();
$this->assertTrue($model->hasUuid());
$model->setRawUuid($uuid);
$this->assertEquals($uuid, $model->getUuid());
}
}