Skip to content
Snippets Groups Projects
Commit 1541483c authored by Patrick Barroca's avatar Patrick Barroca
Browse files

rel #41198 : iframecontainer https under tests

parent feed4b52
Branches
Tags
2 merge requests!1659Master,!1609Hotline#41198 mise en conformite ssl des urls presentes dans le code de bokeh
......@@ -18,27 +18,22 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 - Containeur Iframe pour objets flash et javascript
//////////////////////////////////////////////////////////////////////////////////////////
class ZendAfi_View_Helper_IframeContainer extends ZendAfi_View_Helper_BaseHelper {
protected $_params = [];
protected $_src_args = [];
protected $_url;
//------------------------------------------------------------------------------------------------------
// Main routine
//------------------------------------------------------------------------------------------------------
public function iframeContainer($largeur,$hauteur,$url_array,$preferences = []) {
if($preferences) {
public function iframeContainer($largeur, $hauteur, $url_array, $preferences = []) {
if ($preferences) {
foreach($preferences as $clef => $valeur)
$this->_src_args[$clef] = urlencode($valeur);
}
$this->_url = $this->view->url($url_array, null, true);
$this->_params = ['height' => $hauteur,
'style' => 'border: 0px; overflow:hidden',
'width' => $largeur,
......
......@@ -16,28 +16,52 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class IframeContainerTest extends ViewHelperTestCase
{
public function setUp()
{
$helper = new ZendAfi_View_Helper_IframeContainer();
$helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->html = $helper->iframeContainer('0',
'0',
array('controller' => 'titi',
'action' => 'toto'),
array('param1' => 'value1',
'param2' => 'value2'));
class IframeContainerTest extends ViewHelperTestCase {
protected
$_storm_default_to_volatile = true,
$_helper;
public function setUp() {
$_SERVER['HTTPS'] = 'on';
parent::setUp();
$this->_helper = new ZendAfi_View_Helper_IframeContainer();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->html = $this->_helper->iframeContainer('0',
'0',
['controller' => 'titi',
'action' => 'toto'],
['param1' => 'value1',
'param2' => 'value2']);
}
public function tearDown() {
unset($_SERVER['HTTPS']);
parent::tearDown();
}
/** @test */
public function srcAttributeShouldBeXhtmlValid() {
$this->assertTrue((bool)strpos($this->html, '&'));
}
/** @test */
public function srcAttributeShouldStartWithHttps() {
$this->assertContains('https://', $this->html);
}
/** @test */
public function srcAttributeFromGetHtmlShouldStartWithHttps() {
$this->assertContains('https://', $this->_helper->getHtml());
}
}
?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment