[pLog-svn] r7233 - in plog/branches/lifetype-1.2/class: net test/PHPUnit test/PHPUnit/GUI

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Jul 14 01:06:56 EDT 2020


Author: jondaley
Date: 2020-07-14 01:06:56 -0400 (Tue, 14 Jul 2020)
New Revision: 7233

Modified:
   plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php
   plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/Gtk.php
   plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/SetupDecorator.php
   plog/branches/lifetype-1.2/class/test/PHPUnit/Skeleton.php
Log:
php7 compatibility fixes

Modified: plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php	2020-07-13 06:55:23 UTC (rev 7232)
+++ plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php	2020-07-14 05:06:56 UTC (rev 7233)
@@ -296,7 +296,7 @@
             
             if ( $blogId != $ownerId ) {
             	$blogId = $ownerId;
-            	$blogs =& new Blogs();
+            	$blogs = new Blogs();
 				$blogInfo = $blogs->getBlogInfo($blogId);
 				$blogShortName = $blogInfo->getBlog();
 			} else {

Modified: plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/Gtk.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/Gtk.php	2020-07-13 06:55:23 UTC (rev 7232)
+++ plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/Gtk.php	2020-07-14 05:06:56 UTC (rev 7233)
@@ -64,7 +64,7 @@
  * - Stopping the test in progress
  *
  * To use simply intantiate the class and call main()
- * $gtk =& new PHPUnit_GUI_Gtk;
+ * $gtk = new PHPUnit_GUI_Gtk;
  * $gtk->main();
  *
  * Once the window has finished loading, you can enter the name of
@@ -204,12 +204,12 @@
     function _createUI()
     {
         // Create a window.
-        $window =& new GtkWindow;
+        $window = new GtkWindow;
         $window->set_title('PHPUnit Gtk');
         $window->set_usize(400, -1);
 
         // Create the main box.
-        $mainBox =& new GtkVBox;
+        $mainBox = new GtkVBox;
         $window->add($mainBox);
 
         // Start with the menu.
@@ -250,23 +250,23 @@
     function &_createMenu()
     {
         // Create the menu bar.
-        $menuBar =& new GtkMenuBar;
+        $menuBar = new GtkMenuBar;
 
         // Create the main (only) menu item.
-        $phpHeader =& new GtkMenuItem('PHPUnit');
+        $phpHeader = new GtkMenuItem('PHPUnit');
 
         // Add the menu item to the menu bar.
         $menuBar->append($phpHeader);
 
         // Create the PHPUnit menu.
-        $phpMenu =& new GtkMenu;
+        $phpMenu = new GtkMenu;
 
         // Add the menu items
-        $about =& new GtkMenuItem('About...');
+        $about = new GtkMenuItem('About...');
         $about->connect('activate', array(&$this, 'about'));
         $phpMenu->append($about);
 
-        $exit =& new GtkMenuItem('Exit');
+        $exit = new GtkMenuItem('Exit');
         $exit->connect_object('activate', array('gtk', 'main_quit'));
         $phpMenu->append($exit);
 
@@ -289,20 +289,20 @@
     function &_createSuiteEntry()
     {
         // Create the outermost box.
-        $outerBox         =& new GtkVBox;
+        $outerBox         = new GtkVBox;
 
         // Create the suite label, box, and field.
-        $suiteLabel       =& new GtkLabel('Test class name:');
-        $suiteBox         =& new GtkHBox;
-        $this->suiteField =& new GtkEntry;
+        $suiteLabel       = new GtkLabel('Test class name:');
+        $suiteBox         = new GtkHBox;
+        $this->suiteField = new GtkEntry;
         $this->suiteField->set_text($suiteName != NULL ? $suiteName : '');
 
         // Create the button the user will use to start the test.
-        $runButton =& new GtkButton('Run');
+        $runButton = new GtkButton('Run');
         $runButton->connect_object('clicked', array(&$this, 'run'));
 
         // Create the check box that lets the user show only failures.
-        $this->showPassed =& new GtkCheckButton('Show passed tests');
+        $this->showPassed = new GtkCheckButton('Show passed tests');
 
         // Add the components to their respective boxes.
         $suiteLabel->set_alignment(0, 0);
@@ -331,19 +331,19 @@
     function &_createReportLabels()
     {
         // Create a box to hold everything.
-        $labelBox         =& new GtkHBox;
+        $labelBox         = new GtkHBox;
 
         // Create the non-updated labels.
-        $numberOfRuns     =& new GtkLabel('Runs:');
-        $numberOfErrors   =& new GtkLabel('Errors:');
-        $numberOfFailures =& new GtkLabel('Failures:');
+        $numberOfRuns     = new GtkLabel('Runs:');
+        $numberOfErrors   = new GtkLabel('Errors:');
+        $numberOfFailures = new GtkLabel('Failures:');
 
         // Create the labels that will be updated.
         // These are asssigned to members to make it easier to
         // set their values later.
-        $this->numberOfRuns     =& new GtkLabel(0);
-        $this->numberOfErrors   =& new GtkLabel(0);
-        $this->numberOfFailures =& new GtkLabel(0);
+        $this->numberOfRuns     = new GtkLabel(0);
+        $this->numberOfErrors   = new GtkLabel(0);
+        $this->numberOfFailures = new GtkLabel(0);
 
         // Pack everything in.
         $labelBox->pack_start($numberOfRuns);
@@ -371,7 +371,7 @@
     function &_createProgressBar()
     {
         // Create the progress bar.
-        $this->progress =& new GtkProgressBar(new GtkAdjustment(0, 0, 1, .1, 1, 0));
+        $this->progress = new GtkProgressBar(new GtkAdjustment(0, 0, 1, .1, 1, 0));
 
         // Set the progress bar to print the percentage.
         $this->progress->set_show_text(true);
@@ -393,15 +393,15 @@
     function &_createReportAreas()
     {
         // Create the containing box.
-        $reportBox =& new GtkVBox;
+        $reportBox = new GtkVBox;
 
         // Create the identification label
-        $reportLabel =& new GtkLabel('Errors and Failures:');
+        $reportLabel = new GtkLabel('Errors and Failures:');
         $reportLabel->set_alignment(0, 0);
 
         // Create the scrolled windows for the text areas.
-        $reportScroll =& new GtkScrolledWindow;
-        $dumpScroll   =& new GtkScrolledWindow;
+        $reportScroll = new GtkScrolledWindow;
+        $dumpScroll   = new GtkScrolledWindow;
 
         // Make the scroll areas big enough.
         $reportScroll->set_usize(-1, 150);
@@ -413,8 +413,8 @@
         $dumpScroll->set_policy(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 
         // Create the text areas.
-        $this->reportArea =& new GtkText;
-        $this->dumpArea =& new GtkText;
+        $this->reportArea = new GtkText;
+        $this->dumpArea = new GtkText;
 
         // Don't let words get broken.
         $this->reportArea->set_word_wrap(true);
@@ -444,7 +444,7 @@
     function &_createStatusLine()
     {
         // Create the status label.
-        $this->statusLine =& new GtkLabel('');
+        $this->statusLine = new GtkLabel('');
         $this->statusLine->set_alignment(0, 0);
 
         return $this->statusLine;
@@ -464,20 +464,20 @@
     function about()
     {
         // Create the new window.
-        $about =& new GtkWindow;
+        $about = new GtkWindow;
         $about->set_title('About PHPUnit GUI Gtk');
         $about->set_usize(250, -1);
 
         // Put two vboxes in the hbox.
-        $vBox =& new GtkVBox;
+        $vBox = new GtkVBox;
         $about->add($vBox);
 
         // Create the labels.
-        $version     =& new GtkLabel(" Version: 1.0");
-        $license     =& new GtkLabel(" License: PHP License v3.0");
-        $where       =& new GtkLabel(" Download from: http://pear.php.net/PHPUnit/");
-        $unitAuth    =& new GtkLabel(" PHPUnit Author: Sebastian Bergman");
-        $gtkAuth     =& new GtkLabel(" Gtk GUI Author: Scott Mattocks");
+        $version     = new GtkLabel(" Version: 1.0");
+        $license     = new GtkLabel(" License: PHP License v3.0");
+        $where       = new GtkLabel(" Download from: http://pear.php.net/PHPUnit/");
+        $unitAuth    = new GtkLabel(" PHPUnit Author: Sebastian Bergman");
+        $gtkAuth     = new GtkLabel(" Gtk GUI Author: Scott Mattocks");
 
         // Align everything to the left
         $where->set_alignment(0, .5);
@@ -618,7 +618,7 @@
     function run()
     {
         // Load the test suite.
-        $this->suite =& $this->loadTest($this->suiteField->get_text());
+        $this->suite = $this->loadTest($this->suiteField->get_text());
 
         // Check to make sure the suite was loaded properly.
         if (!is_object($this->suite)) {
@@ -674,7 +674,7 @@
             if (is_a($this->suite, 'PHPUnit_TestSuite')) {
                 $this->suite->addTestSuite($suite->getName());
             } else {
-                $this->suite =& $this->loadTest($suite);
+                $this->suite = $this->loadTest($suite);
             }
 
             // Set the suite field.

Modified: plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/SetupDecorator.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/SetupDecorator.php	2020-07-13 06:55:23 UTC (rev 7232)
+++ plog/branches/lifetype-1.2/class/test/PHPUnit/GUI/SetupDecorator.php	2020-07-14 05:06:56 UTC (rev 7233)
@@ -129,7 +129,7 @@
             lt_include($aFile);
 
             if (class_exists($className)) {
-                $suites[] =& new PHPUnit_TestSuite($className);
+                $suites[] = new PHPUnit_TestSuite($className);
             } else {
                 trigger_error("$className could not be found in $dir$aFile!");
             }

Modified: plog/branches/lifetype-1.2/class/test/PHPUnit/Skeleton.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/PHPUnit/Skeleton.php	2020-07-13 06:55:23 UTC (rev 7232)
+++ plog/branches/lifetype-1.2/class/test/PHPUnit/Skeleton.php	2020-07-14 05:06:56 UTC (rev 7233)
@@ -304,7 +304,7 @@
 
         $this->testClass .=
           "        lt_include('" . $this->classPath . ")';\n" .
-          "        \$this->" . $this->className . " =& new " . $this->className . "(PARAM);\n" .
+          "        \$this->" . $this->className . " = new " . $this->className . "(PARAM);\n" .
           "    }\n\n";
 
         // Create the tearDown method.



More information about the pLog-svn mailing list