simpletest / simpletest Goto Github PK
View Code? Open in Web Editor NEWSimpleTest - Unit Testing for PHP
Home Page: http://simpletest.org
License: GNU Lesser General Public License v2.1
SimpleTest - Unit Testing for PHP
Home Page: http://simpletest.org
License: GNU Lesser General Public License v2.1
I must be missing a trick with structuring my integration tests. I have classes for running specific tests based on input, but now I want to test different classes together and running into problems. I first tried inheritence but quickly realised that approach was limited when I needed to use more than 1 test class (e.g. fooTest, barTest).
I only want to run every 'test' method in bazTest
, while fooTest
and barTest
just provide useful abstractions so that bazTest
is short and understandable.
What I'm trying now is failing with Fatal error: Call to a member function getDumper() on a non-object in /srv/example.com/htdocs/simpletest/test_case.php on line 345
class bazTest extends UnitTestCase { function testStart() { $this->foo = new fooTest(); } function testDo() { $this->foo->doFoo(true); } } class fooTest extends UnitTestCase { function doFoo($foo) { $this->assertTrue($foo); } } class barTest extends UnitTestCase { function doBar($bar) { $this->assertTrue($bar); } }
I guess I'm misunderstanding some concepts, but I thought I remember reading that SimpleTest can do Integration tests and not only Unit tests..
One of the side effects of using the named constructors (<= 1.1.6) was that it was possible to call the __construct
method, late. The use case for this is for setting/adjusting instance variables on your mock prior to the constructor logic being run. With the move to mocks that use the __construct
method this is no longer possible.
We're working around that for now with a custom MockGenerator
that injects the following function into all mocks:
function __constructor() {
call_user_func_array('parent::__construct', func_get_args());
}
This gives us a predictable way to late call the underlying __construct
on any type of mock. Would you be interested in a PR for this functionality in core?
Hi. I guess not. It will cut UTF-8 text in parts, which may contain invalid "characters" at the end. A part of a multibyte characters. Comes in rare cases only... if you work with "รค,ร,.." or else. Simply use mb_strlen, mb_substr.
I am using a browser class and unable to click the following button
input type="button" class="but" name="valid" value="Validate Form" onclick="return myclick()" style="align:center"
I try as -
$browser = new SimpleBrowser();
$browser->clickSubmitByName('valid');
Location:
simpletest/eclipse.php
EclipseReporter::escapeVal($output) . '"}'); (at line 303)
$result = $this->listener->write('{status:"info",message:"' .
EclipseReporter::escapeVal($output) . '"}');
Problem:
Dynamic method called as static
Pull request:
#3
Transfering my comment from the now defunct #8 to an issue to be actively looked into.
tl;dr
ReferenceExpectation
for everything but objects.Hmmm, seems those fails are valid. Looking at them I also suspect that #7 has introduced some potential pit falls. I think perhaps #5 was the way to go after all.
Problem is those ampersands are needed (objects are implicitly byref in PHP5, but scalars and arrays are not). Unfortunately that means it can't inherit (warnings to do with differing method signatures) so the separate class and just tweaking the
isExpectation
method was probably the safest change afterall!Recommend
reopening #5 and reverting #7merging #11.Sorry for the confusion ๐
Just installed simpleTest 1.1.7 on the XAMPP htdocs directory on Windows 7(unziping to it) and got this message after running unit_tests.php. Is there a need to configure any dependency ?
unit_tests.php
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]
Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleExceptionTrappingInvoker->invoke('testMockedInter...') #5
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7 in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code on line 10
When install through Composer, I get this:
unit_tests.php
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774]
Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpl in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code on line 10
Deprecation warnings from the old-style constructor used in MockGenerator::extendClassCode
:
Unexpected PHP Error [Methods with the same name as their class will not be constructors in a future version of PHP; HTMLPurifier_DefinitionTestable has a deprecated constructor] severity [8192] in [simpletest/simpletest/mock_objects.php(1429) : eval()'d code line 1]
$browser->addHeader("Referer: http://myurl.com/index.htm");
echo $browser->getHeaders();
In the echo I did not get the Referer.
I've done some commits to get SimpleTest up and running on Travis-CI.
This build is the first green one after a long time. And yes, it's green on PHP 7 ;)
https://travis-ci.org/simpletest/simpletest/builds/73022256
Warning: tl;tr
Regards, Jens
I was trying to click the href for the following code
<td align="right" nowrap="nowrap">
<a href="newaccout.do">My Details</a>
</td>
$browser->click("My Details");
and it redirect to another page. So I am unable to process next.
$browser->clickSubmit("Submit");
or
$browser->clickSubmitByName("submitAction");
is not working on the following code -
<input type="submit" value="Submit" name="submitAction" onclick="return validate()">
Hi,
We're having an issue with the way classes are handled when building a TestSuite.
We have a hierarchy of test classes that eventually derive from testcase. Some of the classes in the hierarchy are abstract, but other aren't. When the TestSuite is built, the non-abstract classes are added to the TestSuite and an instance of them is constructed. Those classes don't have test methods, so only the constructor is run. The problem is that their constructors perform a long initialization, which is run multiple times (once for each 'parent' class created).
Our hierarchy of classes is something like:
abstract class BaseTest extends UnitTestCase {}
class CommonTest extends BaseTest {}
class TestWithDb extends CommonTest {}
class ATest extends TestWithDb {}
When we try to run ATest, three instances are created: one of ATest (as expected), but also one of TestWithDb and one of CommonTest.
My question is what is the rationale behind it? If the class of the test has a parent class, why is the latter instantiated on its own?
The sequence of the code is:
In SimpleFileLoader:
public function load($test_file)
{
$existing_classes = get_declared_classes();
$existing_globals = get_defined_vars();
include_once($test_file);
$new_globals = get_defined_vars();
$this->makeFileVariablesGlobal($existing_globals, $new_globals);
$new_classes = array_diff(get_declared_classes(), $existing_classes);
if (empty($new_classes)) {
$new_classes = $this->scrapeClassesFromFile($test_file);
}
$classes = $this->selectRunnableTests($new_classes);
return $this->createSuiteFromClasses($test_file, $classes);
}
scrapeClassesFromFile(): finds all the classes of our hierarchy.
selectRunnableTests(): marks as ignored only abstract classes
createSuiteFromClasses(): ignores only the parent of ignored classes, creates one instance of the remaining ones.
Regards,
Alejandro
I would like to inquire about the status of simpletest. The last release was in October of 2015, so getting close to 2 years ago now. I'm guessing there are 4 possibilities as to why this is. 1) The code has been unfit for release since then. 2) There have not been significant enough changes to warrant a release. 3) The project is not actively maintained enough for someone to prepare a release even though they are believed in by the maintainer. 4) You don't believe in releases and always consider the master branch to be the latest release and fit for use.
I put this up as I encountered a web page, whos content was sliced into chunks. This comes with HTTP/1.1 and its header "Transfer-Encoding: chunked". The chunks start with a hexadecimal number for their size and a "0" for the last chunk. With "echo $this->get(..);" you will see them. Chunks and HTTP/1.1 is a general behaviour these days.
Simpletest uses "GET /mypage.php HTTP/1.0" in http.php telling a server it will not understand the "Transfer-Encoding: chunked" header. That is why I should NOT have seen any chunked content.
I tested with 5 servers today. Two of them sent me chunked content. As I am not into (Apache) server configuration I cannot say much to why it was not handled.
https://httpd.apache.org/docs/2.2/de/env.html
One can always set the "Content-Lenght: 1234" header in the application itself, which whould prevent servers (e.g. Apache) from chunking.
Another way is to enable Simpletest to handle HTTP/1.1 protocol. That may be more an effort than just the chunked content. Here is some info about how much work it is to dechunk:
http://stackoverflow.com/questions/10793017/how-to-easily-decode-http-chunked-encoded-string-when-making-raw-http-request
I guess in the very long run Simplettest cannot stay with HTTP/1.0. So its about selecting information already about how to go that way.
Just wondering. Application redirects to the referer at one point. To test I have to set the referer header manually. I'd the referer is user agents standard. Just drop this here...
We can remove some lines of code by de-duplicating the network_confirm.php
code.
My suggestion is to use one central script for request mirroring.
The idea is to build a JSON response and use array/object access in tests.
(Basically a note for myself, before the idea gets lost.)
Quick draft:
$url = 'http://';
if (isset($_SERVER['HTTPS'])) {
$url = 'https://';
}
$url .= "{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
if ($_SERVER['QUERY_STRING']) {
$url .= "?{$_SERVER['QUERY_STRING']}";
}
$request = array(
'body' => file_get_contents('php://input'),
'headers' => getallheaders(),
'origin' => $_SERVER['REMOTE_ADDR'],
'method' => $_SERVER['REQUEST_METHOD'],
'params' => array(
'get' => $_GET,
'post' => $_POST,
),
'url' => $url,
);
header('Content-Type: application/json');
echo json_encode($request);
Because of message formatting uses sprinf, assert methods fail if the message contains percent sign:
Unexpected PHP Error [sprintf(): Too few arguments] severity [2] in [/media/sf_projects/html/simpletest2/test_case.php line 311]
Hello
It common to to set a cookie for all subdomains by setting DOMAIN parameter of cookie to:
.mydomain.com
Unfortunately it doesn't work under WebTester. For example a cookie set for www.mydomain.com is not accessible for subsequently opened page: www.subdomain.mydomain.com.
I've confirmed, cookies work under WebTester while opening pages from the same subdomain as cookie was set.
This issue appear in v1.10 as well as 1.1.8-dev
with regards
I'm sorry to open a new issue for this, but I just wanted to take a moment to say "thank you" for Simpletest. Several years ago, I took over a large, procedural, ecommerce project and I briefly experimented with PHPUnit before giving up because I couldn't get it running in our system and with our server because of some of our design and technical limitations. Flash forward to a few weeks ago, when I stumbled upon Simpletest. Some quick research made it look more flexible than PHPUnit and it could run tests on our server via a browser. Sure enough, in just a couple of days I had it set up and was at about 15-20% coverage. Incredible!
All of our code is still being run via require
and require_once
statements, and Simpletest made it ... well, simple ... or at least as simple as possible ... to setup some global variables, require
a single script or file, and then check assertions on the side effects or global variables that the require
script left behind. Now, after just a week or so, we're at over 50% coverage and that is quickly climbing.
So: Thank you! Danke! Merci!
I'd love to see support for date and time inputs. See PR #60.
The first thing you see when you get to the website is:
[23/01/2012] SimpleTest 1.1.0 is available. It's the first release in maintenance mode.
(emphasis on date mine)
Whilst it may be true that 1.1.0
is still the only version in maintenance mode, that date is really old now. I was really happy to see that there's a Github account with activity. I only discovered this after coming across a Stack Overflow answer that mentioned the project is not abandoned.
That made me really happy as I looked for a long time to find something like this for my own testing and fell in love. I think for the sake of others who will come across the website and not realise there's activity, the above block should be moved to a less prominent location and an indicator put in off activity. Perhaps one of those snazzy "fork me on Github" banners everyone seems to like these days?
If you'd like some help with the site I'd be happy to help out or put in some PRs if you make it a public repo.
How to reproduce ?
Instanciate a mock in a constructor or run:
$> php test/mock_objects_test.php
PHP Fatal error: Uncaught Error: Call to a member function tell() on null in /.../vendor/simpletest/simpletest/mock_objects.php:711
Replacing my ancient bug report with an up-to-date one:
reflection.php has code for generating a nullable return type in a method signature, but the code seems to have 2 problems:
getReturnType
returns null (or is empty string in the casted-to-string form it's currently being used), so in that case it generates a signature with just a floating : ?
, which causes a syntax error when the code gets eval'd in a mock class.Just removing the whole block removes the syntax error and is probably a step forward.
Hello,
I look for a example of simpletest with namespaces.
I'm a beginner in unit testing.
How can help ?
Your sincerly
Stephan
`diff --git a/browser.php b/browser.php
index 09aa295..ec25d84 100644
--- a/browser.php
+++ b/browser.php
@@ -248,7 +248,8 @@ class SimpleBrowser
}
/**
* Switches back on the cookie sending and recieving.
* Switches back on the cookie sending and recieving.
* @access public
*/
public function useCookies()
{
@@ -256,6 +257,27 @@ class SimpleBrowser
}
/**
* Get current list of cookies
* @access public
* @return array
*/
public function getCookies()
{
return $this->user_agent->getCookies();
}
/**
* Import a list of cookies
* @access public
* @param array
*/
public function setCookies(array $lstCookies)
{
return $this->user_agent->setCookies($lstCookies);
}
/**
diff --git a/cookies.php b/cookies.php
index ed25d08..dfff5d9 100644
--- a/cookies.php
+++ b/cookies.php
@@ -288,6 +288,16 @@ class SimpleCookieJar
}
/**
* Return a list of the current cookies
* @access public
* @return array
*/
public function getCookies()
{
return $this->cookies;
}
/**
/**
* Get current list of cookies
* @access public
* @return array
*/
public function getCookies()
{
$lstCookies = $this->cookie_jar->getCookies();
$aCookies = [];
foreach($lstCookies as $oCookies) {
$aCookies[] = [
'name'=>$oCookies->getName(),
'value'=>$oCookies->getValue(),
'host'=>$oCookies->getHost(),
'path'=>$oCookies->getPath(),
'expiry'=>$oCookies->getExpiry(),
];
}
return $aCookies;
}
/**
* Import a list of cookies
* @access public
* @param array
*/
public function setCookies(array $lstCookies)
{
foreach($lstCookies as $aCookies) {
$this->cookie_jar->setCookie(
$aCookies['name'],
$aCookies['value'],
$aCookies['host'],
$aCookies['path'],
$aCookies['expiry']
);
}
}
/**
Do you have any plans to integrate Simpletest with NetBeans?
Currently I have no idea about requirements of such integration. For sure it all about writing NB plugin which can process simpletest output.
with regards
Recently I wrote a test for web form which supports file uploads (with use of common file input method).
At first please note, the form submitted in real browsers works as expected.
The same page submitted under WebTester, reports wrong mime of uploaded files.
I mean, the field $_FILES['somefile']['type'] contains 'application/octet-stream' instead of 'image/jpeg'.
In the meantime function mime_content_type($_FILES['somefile']['tmp_name']) returns proper and expected jpeg mime.
Question is, could it be SimpleTest related issue or rather environment related one? Before providing test case for the issue I would rather ask first. Maybe you will just know the answer.
BTW I'm using SimpleTest from time to time for a few years right now. And I'm still amazed at SimpleTest abilities. Thank you
The following is the web test post request header, please bring a cookie in each request, otherwise can not keep session
----Translation from Google translation
HTTP/1.1 200 OK
Date: Wed, 20 Sep 2017 10:01:08 GMT
Server: Apache/2.4.27 (Debian)
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Length: 105
Connection: close
Content-Type: application/json; charset=utf-8
I know that we can use getTests()
to get a list of all tests in a UnitTestCase
, but I haven't been able to figure out if it's possible to access the test/method that's currently being run, setup, or checked for skipping.
Hello,
I am trying to access https://xxx.my.salesforce.com/ using SimpleBrowser, but I get a message from the website to use a browser that supports TLS 1.1 or TLS 1.2 because SourceForce disabled TLS 1.0. There is a public announcement at https://help.salesforce.com/HTViewSolution?id=000221207.
Is there a way to enable TLS 1.1 or TLS 1.2 using SimpleBrowser?
Thanks!
UTF-8 is more or less standard now.
Hi,
I cannot check for the name(title) of an object. Say it is displayed as <h1> on the web page, but again the string is used within the <title> tag. In page->getText() the string can found twice accordingly. What I would need is to restrict the extraction of text on the part of the page in order to test <title> and <h1> separately. Just put this here. Is no major thing.
Henri
Hey guys, I'm needing the simpletest release 1.01, 'Cauz using cakephp 1.3. This framework uses simpletest 1.01 (Yeap, i know :S) and i'm trying to make composer.json with simpletest but i didnt find this version.
Hi,
used an older version of simpletest and upgraded now to the master as I required namespaced mocks (great btw).
Unfortunately it seems that interfaces having methods defining the class type in arguments cannot be mocked any more. Assuming a class:
interface PluginFactory
{
function setConfig(Config $config);
}
produces this error:
Declaration of MockPluginFactory::setConfig() must be compatible with PluginFactory::setConfig(Config $config)
Best regards,
Philipp
Is this project still alive? I ask because the linked website is broken and therefore no documentation is available.
If it is still alive:
It it is not alive:
I recently built a test that intentionally causes an exception and capture that exception using the expectException
function. I did not realize that after the exception is thrown the test is ended even if their are additional assert statements after the exception.
It took nearly an hour to figure out why my asserts were not being seen. I had to find the answer from some outdated forum that on exception the test ends. This is not listed in the official documentation. This is also very poor usability.
At the lest the documentation needs to be updated.
Better would be to remove function and force users to try/catch the exception on their own so they don't fall into the trap I did. Or best find a way for the function to capture exception and continue the test.
Hello,
I think there is a problem with some dynamic methods that are called as static methods. And calling a dynamic method statically generates the E_STRICT error with PHP 5. Could you please check that and update Simpletest?
The following dynamic methods are called statically:
vendor/simpletest/simpletest/test/site/front_controller_style/show_request.php:21
vendor/simpletest/simpletest/test/site/front_controller_style/show_request.php:35
vendor/simpletest/simpletest/test/site/path/network_confirm.php:41
vendor/simpletest/simpletest/test/site/network_confirm.php:41
vendor/simpletest/simpletest/test/site/protected/network_confirm.php:41
vendor/simpletest/simpletest/test/site/path/network_confirm.php:55
vendor/simpletest/simpletest/test/site/protected/network_confirm.php:55
vendor/simpletest/simpletest/test/site/network_confirm.php:61
vendor/simpletest/simpletest/extensions/coverage/test/coverage_calculator_test.php:70
vendor/simpletest/simpletest/extensions/coverage/test/simple_coverage_writer_test.php:71
This issue is similar to issue #2.
Thanks ;)
Guillaume
Firstly, thank you for providing this project to make the PHP unit testing easily.
When I refer the documentation, it only has the English version now.
If possible, I can provide the traditional Chinese version for this project.
I will also publish the tutorial post on my blog.
How can I contribute the documentation?
Thanks.
Warning: Ambiguous class resolution, "SimpleReflection" was found in both "vendor/simpletest/simpletest/reflection_php4.php" and "vendor/simpletest/simpletest/reflection_php5.php", the first will be used.
Composer seems to iterate in filesystem order, so this class effectively gets chosen at random on each distinct installation, although the php5
variant is the correct one in my environment.
I don't think this makes a difference (the class isn't actually autoloaded, so if the wrong one was in the autoloader, nothing bad happens) unless client code accidentally triggers the autoload before SimpleTest gets a chance to do its own direct loading. Still, I would like the warning to be fixed.
In fact, I think the php4
file can just be deleted. composer.json
and the bundled docs both say 1.1+ are PHP5-only, and I can't find anywhere that would load the php4
variant.
The link given in Readme http://simpletest.org/en/first_test_tutorial.html
points to site which is not reponding. Same for http://simpletest.org/
.
Hi. I've been making some PHP recently and I found a bug using SimpleText; here's the way to reproduce it.
class TestBuggy extends UnitTestCase {
function testShouldBeFalse() {
$this->assertEqual(True, 3);
}
}
The code compilates and returns no error, while it should.
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.