mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-06 15:28:58 +01:00
- #13779: Fixed `yii\db\ActiveRecord::joinWith()` unable to use relation defined via attached behavior. - #5786: Allowed to use custom constructors in ActiveRecord-based classes.
22 lines
566 B
PHP
22 lines
566 B
PHP
<?php
|
|
|
|
namespace yiiunit\framework\base;
|
|
|
|
use yiiunit\data\base\Singer;
|
|
use yiiunit\data\base\Speaker;
|
|
use yiiunit\TestCase;
|
|
|
|
class StaticInstanceTraitTest extends TestCase
|
|
{
|
|
public function testInstance()
|
|
{
|
|
$speakerModel = Speaker::instance();
|
|
$this->assertTrue($speakerModel instanceof Speaker);
|
|
|
|
$singerModel = Singer::instance();
|
|
$this->assertTrue($singerModel instanceof Singer);
|
|
|
|
$this->assertSame($speakerModel, Speaker::instance());
|
|
$this->assertNotSame($speakerModel, Speaker::instance(true));
|
|
}
|
|
} |