/** * @test */ public function getAttributeFromTagWithSeveralSrcAttributes() { $path1 = 'uploads/pics/foo.jpg'; $path2 = 'typo3temp/tx_foo/bar.gif'; $content = '<img src="' . $path1 . '" data-custom-src="' . $path2 . '" style="width: 15px;" />'; $hits = $this->extractor->getAttributeFromTag('img', 'src', $content); $this->assertInternalType('array', $hits); $this->assertInternalType('array', $hits['paths']); $this->assertInternalType('array', $hits['masks']); $this->assertEquals(1, sizeof($hits['paths'])); $this->assertEquals(1, sizeof($hits['masks'])); $this->assertEquals($path1, $hits['paths'][0]); $this->assertEquals('"', $hits['masks'][0]); }
/** * @param string $tagName * @param string $attributeName * @param string $content * @param array $requiredOtherAttributes * @return Tx_Asdis_Domain_Model_Asset_Collection */ protected function getAssets($tagName, $attributeName, $content, array $requiredOtherAttributes = array()) { $attributes = $this->xmlTagAttributeExtractor->getAttributeFromTag($tagName, $attributeName, $content, $requiredOtherAttributes); return $this->assetFactory->createAssetsFromPaths($attributes['paths'], $attributes['masks']); }