Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
howyi committed Jul 31, 2017
1 parent 4577e16 commit fc903ab
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ php:
before_script:
- composer install --dev
script:
- vendor/bin/phpunit --coverage-php=build/log/clover.xml
- vendor/bin/phpunit --coverage-clover=build/log/clover.xml
after_success:
- travis_retry php vendor/bin/coveralls -v
notifications:
Expand Down
15 changes: 15 additions & 0 deletions tests/Conv/Factory/DatabaseStructureFactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Conv\Factory;

use Conv\Structure\DatabaseStructure;

class DatabaseStructureFactoryTest extends \PHPUnit\Framework\TestCase
{
public function testFromYaml()
{
$actual = DatabaseStructureFactory::fromDir('tests/schema/');
// TODO
$this->assertInstanceOf(DatabaseStructure::class, $actual);
}
}
15 changes: 15 additions & 0 deletions tests/Conv/Factory/TableStructureFactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Conv\Factory;

use Conv\Structure\TableStructure;

class TableStructureFactoryTest extends \PHPUnit\Framework\TestCase
{
public function testFromYaml()
{
$actual = TableStructureFactory::fromYaml('tests/schema/tbl_player.yaml');
// TODO
$this->assertInstanceOf(TableStructure::class, $actual);
}
}
41 changes: 41 additions & 0 deletions tests/schema/tbl_player.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
table: tbl_player
comment: Player management table
column:
player_id:
type: int
unsigned: true
nullable: false
comment: Unique player ID
name:
type: varchar
nullable: false
comment: Player name
age:
type: int
unsigned: false
nullable: false
comment: Player age
level:
type: int
unsigned: false
nullable: false
comment: Player character level
konnnitiha: true
exp:
type: int
unsigned: false
nullable: false
comment: Player character exp
registered_at:
type: datetime
nullable: false
comment: Player registered date
primaryKey:
- player_id
- name
index:
period:
isUnique: true
column:
- id
- level

0 comments on commit fc903ab

Please sign in to comment.