setTitle($title); $asset->setAlias('dummy-alias'); $asset->setStorageLocation('local'); $asset->setPath('broken-image.jpg'); $asset->setExtension('jpg'); $this->em->persist($asset); $this->em->flush(); $this->em->detach($asset); $crawler = $this->client->request('GET', sprintf('/s/assets/view/%d', $asset->getId())); $imageTag = $crawler->filter('.tab-content.preview-detail img'); $onError = $imageTag->attr('onerror'); $altProp = $imageTag->attr('alt'); Assert::assertNull($onError); Assert::assertSame($title, $altProp); } }