Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit f361349

Browse files
committed
Fixes zendframework#488 - Zend_Dojo_View_Helper_Dojo_Container setCdnVersion
1 parent 6a53a89 commit f361349

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

library/Zend/Dojo/View/Helper/Dojo/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ public function getCdnBase()
430430
public function setCdnVersion($version = null)
431431
{
432432
$this->enable();
433-
if (preg_match('/^[1-9]\.[0-9](\.[0-9])?$/', $version)) {
433+
if (preg_match('/^[1-9]\.[0-9]{1,2}(\.[0-9]{1,2})?$/', $version)) {
434434
$this->_cdnVersion = $version;
435435
}
436436
return $this;

tests/Zend/Dojo/View/Helper/DojoTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@ public function testShouldAllowSpecifyingDojoVersionWhenUtilizingCdn()
235235
$this->assertEquals('1.0', $this->helper->getCdnVersion());
236236
}
237237

238+
/**
239+
* @group GH-488
240+
*/
241+
public function testSetCdnVersionForHigherMinorReleases()
242+
{
243+
$this->helper->setCdnVersion('1.10');
244+
$this->assertEquals('1.10', $this->helper->getCdnVersion());
245+
}
246+
247+
/**
248+
* @group GH-488
249+
*/
250+
public function testSetCdnVersionForHigherMiniReleases()
251+
{
252+
$this->helper->setCdnVersion('1.10.29');
253+
$this->assertEquals('1.10.29', $this->helper->getCdnVersion());
254+
}
255+
238256
public function testShouldUseAolCdnDojoPathByDefault()
239257
{
240258
$this->assertEquals(Zend_Dojo::CDN_DOJO_PATH_AOL, $this->helper->getCdnDojoPath());

0 commit comments

Comments
 (0)