Elgg\EntityIconServiceTest::testIconLastChangedTime PHP Метод

testIconLastChangedTime() публичный Метод

    public function testIconLastChangedTime()
    {
        $service = $this->createService();
        $local_file = $this->config()->get('dataroot') . '1/1/400x300.png';
        $service->saveIconFromLocalFile($this->entity, $local_file);
        $this->assertTrue($service->hasIcon($this->entity, 'small'));
        $icon = $service->getIcon($this->entity, 'small');
        $this->assertEquals(filemtime($icon->getFilenameOnFilestore()), $service->getIconLastChange($this->entity, 'small'));
        sleep(1);
        $icon->setModifiedTime();
        $this->assertEquals(filemtime($icon->getFilenameOnFilestore()), $service->getIconLastChange($this->entity, 'small'));
    }