Elgg\EntityIconServiceTest::testCanReplaceDefaultIconURL PHP Method

testCanReplaceDefaultIconURL() public method

    public function testCanReplaceDefaultIconURL()
    {
        $this->hooks->registerHandler('entity:icon:url', 'object', function () {
            return '/path/to/icon.png';
        });
        $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(elgg_normalize_url('/path/to/icon.png'), $service->getIconURL($this->entity, 'small'));
    }