ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
340 stars 45 forks source link

Di, cleanup #226

Closed Yahasana closed 6 years ago

mruz commented 6 years ago

Could you please add a simple test, please? \Ice\Mcv\Service extends Access, so

tests/App/Services/UserService.php

<?php

namespace Tests\App\Services;

use Ice\Mvc\Service;
use Tests\App\Models\Users;

class UserService extends Service
{
    public function __construct(Users $model)
    {
        $this->setModel($model);
    }
}

and to tests/ModelsTest.php

    /**
     * Service test
     */
    public function testService()
    {
        $service = new \Tests\App\Services\UserService(new Users());

        $this->assertInstanceOf(\Ice\Di::class, $service->di);
        $this->assertInstanceOf(\Ice\Config::class, $service->config);
        $this->assertInstanceOf(\Ice\Db::class, $service->db);
    }

then we could try the previous version, maybe it works with the latest Zephir.

Yahasana commented 6 years ago

i have updated and just removed redendent is object test. No any other changes