Skip to content

Commit

Permalink
TestModel class is loaded via autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Mar 24, 2021
1 parent 4670052 commit 5722b70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 9 additions & 6 deletions tests/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@
*/
class ModelTest extends NanoBaseTest
{
/**
* @var TestModel
*/
private $model;

public function setUp(): void
{
$dir = __DIR__ . '/app';
$this->app = Nano::app($dir);
parent::setUp();
$this->model = new TestModel();
}

public function testGetMagic()
{
$model = new TestModel();

$this->assertEquals($model->getData(), ['foo' => 'bar']);
$this->assertEquals($model->getFoo(), 'bar');
$this->assertEquals(['foo' => 'bar'], $this->model->getData());
$this->assertEquals('bar', $this->model->getFoo());
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

namespace Tests\App\Models;

use Model;

/**
* An example model
*
* @method array getFoo
*/
class TestModel extends Model
{
Expand Down

0 comments on commit 5722b70

Please sign in to comment.