Код: Выделить всё
namespace app\controllers;
use Yii;
use app\entities\Section\SectionEnt;
class SectionController extends BaseController {
public function actionIndex() {
echo 'test';
new SectionEnt();
}
Код: Выделить всё
namespace app\entities\Section;
class SectionEnt {
private $_id;
private $_name;
private $_status;
public function __construct(SectionId $id, SectionName $name){
$this->_id = $id;
$this->_name = $name;
}
Код: Выделить всё
namespace tests\unit\entities;
use app\entities\Section\SectionEnt;
use Codeception\Test\Unit;
class CreateTest extends Unit {
// tests
public function testSomeFeature() {
$section = new SectionEnt(
$id = new SectionId(1),
$name = new SectionName('Section')
);
// $this->assertEquals($id, $section->getId());
// $this->assertEquals($name, $section->getName());
}
}