开发者

Test if a file is loaded

开发者 https://www.devze.com 2023-02-06 01:42 出处:网络
Is there a way in phpUnit to test if for example a certain css file is loaded? In other 开发者_开发技巧words, i want to check if a css file is loaded (if possible). I want to make sure the HMTL outpu

Is there a way in phpUnit to test if for example a certain css file is loaded?

In other 开发者_开发技巧words, i want to check if a css file is loaded (if possible). I want to make sure the HMTL output has a style tag with a certain css file.


You can do it as Foe example the page source will display the css file as

<style src="mycss.css" type="text/css"></style>

Then following statement will check that the element present or not

$this->assertTrue($this->isElementPresent("//style[@src='mycss.css']"));
0

精彩评论

暂无评论...
验证码 换一张
取 消