Author: ornicar2
Date: 2010-01-20 03:52:27 +0100 (Wed, 20 Jan 2010)
New Revision: 26907

Modified:
   plugins/diemPlugin/trunk/dmAdminPlugin/lib/webService/dmDiemVersionCheck.php
   plugins/diemPlugin/trunk/dmCorePlugin/test/unit/dmVersionCheckTest.php
Log:
[Diem]
- added diem_version_check service enabled options
- updated diem_version_check service unit tests

Modified: 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/webService/dmDiemVersionCheck.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/webService/dmDiemVersionCheck.php    
    2010-01-20 02:45:09 UTC (rev 26906)
+++ 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/webService/dmDiemVersionCheck.php    
    2010-01-20 02:52:27 UTC (rev 26907)
@@ -22,7 +22,7 @@
 
   public function shouldCheck()
   {
-    return !$this->getService('user')->getAttribute('version_check', false, 
'dm');
+    return $this->getOption('enabled') && 
!$this->getService('user')->getAttribute('version_check', false, 'dm');
   }
 
   public function isUpToDate()

Modified: plugins/diemPlugin/trunk/dmCorePlugin/test/unit/dmVersionCheckTest.php
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/test/unit/dmVersionCheckTest.php      
2010-01-20 02:45:09 UTC (rev 26906)
+++ plugins/diemPlugin/trunk/dmCorePlugin/test/unit/dmVersionCheckTest.php      
2010-01-20 02:52:27 UTC (rev 26907)
@@ -30,6 +30,18 @@
 
 $t->ok($versionCheck->shouldCheck(), 'versionCheck should check');
 
+$t->comment('disable version check');
+
+$versionCheck->setOption('enabled', false);
+
+$t->ok(!$versionCheck->shouldCheck(), 'versionCheck should not check');
+
+$t->comment('enable version check');
+
+$versionCheck->setOption('enabled', true);
+
+$t->ok($versionCheck->shouldCheck(), 'versionCheck should check');
+
 $t->is($versionCheck->getLatestServerVersionForBranch('5.0'), '5.0.4', 'Latest 
version for 5.0 is 5.0.4');
 
 $t->is($versionCheck->getLatestServerVersionForBranch('5.1'), '5.1.0-BETA2', 
'Latest version for 5.1 is 5.1.0-BETA2');

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to