Releases: erikgall/eloquent-phpunit
Releases · erikgall/eloquent-phpunit
v1.0.7
v1.0.6
Code Refactoring
src/Database/Column.php
now uses magic methods- Removed methods from Column class (integer, string, text,
Column Increments method
You now do not have to call the integer method when testing if a column increments. The integer method is called for you (see example).
// Old way that still works
$this->table->column('id')->integer()->increments();
// New shortcut
$this->table->column('id')->increments();
Testing Nullable
// The first two examples are the old way this still works.
$this->table->column('name')->string()->nullable();
$this->table->column('name')->string()->notNullable();
// New shortcut to test if a column is nullable
$this->table->column('name')->string()->null();
$this->table->column('name')->string()->notNull();
Column defaults
// Old way that still works
$this->table->column('name')->string()->defaults('User Name');
// New shortcut to testing a columns default
$this->table->column('name')->string()->default('User Name');
v1.0.5
v1.0.4
Database Test Helper
You can now use the database test helper outside of the eloquent test case.
use EGALL\EloquentPHPUnit\DatabaseTestHelper;
class LoginTest extends TestCase {
use DatabaseTestHelper;
// Set the default database seeder class
protected $defaultSeeder = 'DatabaseSeeder';
// Set multiple seeders to be called instead of just the default
protected $seeders = ['UsersTableSeeder', 'PostsTableSeeder'];
// Turn off database seeding (on by default)
protected $seedDatabase = false;
}
Bug Fixes
- Fixed the call to the default seeder method (was calling property).
v1.0.3
SQLite Database Issue
There seems to be an issue if you use a SQLite database for testing and testing foreign keys.
Breaking Changes
- The database column assertion method for default values was updated from
default($val)
todefaults($val)
This was due to the word default
being a reserved word in PHP 5 (not originally supported by package) and not in PHP 7.