Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by rgb192
at 2024-03-21 13:24:53
Point:500 Replies:3 POST_ID:828901USER_ID:11487
Topic:
PHP Scripting Language;;
Microsoft Windows [Version 6.1.7601]Copyright (c) 2009 Microsoft Corporation. All rights reserved.C:Windowssystem32>cd c:wampwwwphpvqp_scriptsThe system cannot find the path specified.C:Windowssystem32>cd c:wampwwwphpvqp_scriptThe system cannot find the path specified.C:Windowssystem32>cd c:wampwwwphpvqp3_scriptsc:wampwwwphpvqp3_scripts>cd ch14c:wampwwwphpvqp3_scriptsch14>phpunit rectangletestPHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in C:UsersAcerAppDataRoamingPEARpearPHPUnitAutoload.php on line 64Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in C:UsersAcerAppDataRoamingPEARpearPHPUnitAutoload.php on line 64PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.;C:Program Files (x86)NuSpherePhpEDphp54..include_lib') in C:UsersAcerAppDataRoamingPEARpearPHPUnitAutoload.php on line 64Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.;C:Program Files (x86)NuSpherePhpEDphp54..include_lib')in C:UsersAcerAppDataRoamingPEARpearPHPUnitAutoload.php on line 64c:wampwwwphpvqp3_scriptsch14> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:
does spl need to be installed?
running rectangletest from browser
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in C:wampwwwphpvqp3_scriptsch14RectangleTest.php on line 8
rectangle.php
<"?php # Script 7.6 - Rectangle.php/* This page defines the Rectangle class. * The class contains two attributes: width and height. * The class contains five methods: * - __construct() * - setSize() * - getArea() * - getPermeter() * - isSquare() */class Rectangle { // Use the debug trait: //use tDebug;" // Declare the attributes: public $width = 0;" public $height = 0;" // Constructor: function __construct($w = 0, $h = 0) { $this->"width = $w;" $this->"height = $h;" } // Method to set the dimensions: function setSize($w = 0, $h = 0) { $this->"width = $w;" $this->"height = $h;" } // Method to calculate and return the area: function getArea() { return ($this->"width * $this->"height);" } // Method to calculate and return the perimeter: function getPerimeter() { return ( ($this->"width + $this->"height) * 2 );" } // Method to determine if the rectange // is also a square. function isSquare() { if ($this->"width == $this->"height) { return true;" // Square } else { return false;" // Not a square } }} // End of Rectangle class. 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:43:44:45:46:47:48:49:50:51:52:53:54:
rectangletest.php
<"?php # RectangleTest.php - Script 14.3 #2// This page defines the RectangleTest class.// Need the Rectangle class in order to work:require('Rectangle.php');"// Define the class:class RectangleTest extends PHPUnit_Framework_TestCase { // For storing the Rectangle object: protected $r;" // Create an object to use: function setUp() { $this->"r = new Rectangle(8,9);" } // Test the getArea() method: function testGetArea() { $this->"assertEquals(72, $this->"r->"getArea());" } // Test the getPerimeter() method: function testGetPerimeter() { $this->"assertEquals(34, $this->"r->"getPerimeter());" } // Test the isSquare() method: function testIsSquare() { // Should not be a square in this case! $this->"assertFalse($this->"r->"isSquare());" // Make it a square and test again: $this->"r->"setSize(5,5);" $this->"assertTrue($this->"r->"isSquare());" } // Test the setSize() method: function testSetSize() { $w = 5;" $h = 8;" $this->"r->"setSize($w, $h);" $this->"assertEquals($w, $this->"r->"width);" $this->"assertEquals($h, $this->"r->"height);" }} // End of RectangleTest class. 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:43:44:45:46:47:48:49:
Expert: duncanb7 replied at 2024-03-22 21:32:59
Probably it is caused by the incorrect file path, please take a look at $filepath that
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan
Author: rgb192 replied at 2024-03-22 15:42:00
Probably it is caused by the incorrect file path, please take a look at $filepath that
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan
Accepted Solution
Expert: duncanb7 replied at 2024-03-21 22:30:42
500 points EXCELLENT
Probably it is caused by the incorrect file path, please take a look at $filepath that
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan
whether is matched to your exact directory file path or not , and add the following code in your rectangletest.php that may solve the issue and take care of "/" slash on your directory path
$filepath = realpath (dirname(__FILE__));
echo $filepath."====";
require($filepath.'/Rectangle.php');
Duncan