Phalcon\Test\Unit\Assets\ManagerTest::testAssetsManagerAddingJs PHP Method

testAssetsManagerAddingJs() public method

Tests addJs
Since: 2014-10-13
Author: Nikolaos Dimopoulos ([email protected])
    public function testAssetsManagerAddingJs()
    {
        $this->specify("The addJs on assets manager does add resources correctly", function () {
            $assets = new Manager();
            $assets->addJs('/js/script1.js');
            $assets->addJs('/js/script2.js');
            $collection = $assets->get('js');
            $number = 0;
            foreach ($collection as $resource) {
                expect('js')->equals($resource->getType());
                $number++;
            }
            expect($number)->equals(2);
        });
    }