Josegonzalez\Upload\Test\TestCase\File\Path\Basepath\DefaultTraitTest::testModelFieldYearWithMonthAndDayPath PHP Method

testModelFieldYearWithMonthAndDayPath() public method

    public function testModelFieldYearWithMonthAndDayPath()
    {
        $mock = $this->getMockForTrait('Josegonzalez\\Upload\\File\\Path\\Basepath\\DefaultTrait');
        $mock->entity = $this->getMock('Cake\\ORM\\Entity');
        $mock->table = $this->getMock('Cake\\ORM\\Table');
        $mock->settings = ['path' => 'webroot{DS}files{DS}{model}{DS}{field}{DS}{year}{DS}{month}{DS}{day}{DS}'];
        $mock->data = ['name' => 'filename'];
        $mock->field = 'field';
        $mock->entity->expects($this->once())->method('get')->will($this->returnValue(1));
        $mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
        $this->assertEquals('webroot/files/Table/field/' . date("Y") . '/' . date("m") . '/' . date("d") . '/', $mock->basepath());
    }