Errors in PHPUnit itself - unit-testing

PHP Notice: Please no longer include "PHPUnit/Framework.php". in /usr/share/php/PHPUnit/Framework.php on line 50
Fatal error: Class 'PHPUnit_Runner_StandardTestSuiteLoader' not found in /usr/share/php/PHPUnit/TextUI/TestRunner.php on line 434
PHP Fatal error: Class 'PHPUnit_Runner_StandardTestSuiteLoader' not found in /usr/share/php/PHPUnit/TextUI/TestRunner.php on line 434
/var/www/nrka2/build/build.xml:30: exec returned: 255
BUILD FAILED (total time: 2 seconds)
Hello I got this error in the latest phpUnit version. Any ideas how to solve it?

Change your inclusion to PHPUnit/Autoload.php.

Look in your folder that contains your tests.
For example, in Symfony2, there is a Tests folder under each bundle folder. Then you have to browse through the sub directories until you find the test file
e.g. login_databaseTest.php
You will see a line
require_once 'PHPUnit/Framework.php';
Use a good IDE that has a search feature and search your entire project.
I originally though this was some file in the PHPUnit directory, under PHP. Not so. The files needing modified are generated test files that include this line needing modified.

Related

Protoc Output Directory Issue - No Such File or Directory

I recently finished the basic tutorial for C++ here and wanted to set up a project based on the proto files from here. I followed a similar directory structure as the tutorial and changed up the CMakeLists.txt file to accommodate the new files.
I'm currently trying to just compile the manager.proto file. I was able to compile the file and get my server/client files, however the files are being outputted within cmake/build/minknow_api rather than the expected cmake/build folder. This meant the make command would return the error:
clang: error: no such file or directory: '/Users/name/Documents/grpc/examples/cpp/minknow_api/cmake/build/manager.grpc.pb.cc'
clang: error: no input files
I read that it was because protoc outputs based on the imports of the proto file, i.e the file comes with import minknow_api/device.proto for instance. I copied the files from within the cmake/build/minknow_api into cmake/build/ and reran make and it seemed to work, however, the C++ file imports as expected are searching within a minknow_api directory, meaning I'd have to manually edit these imports to look within the current directory instead of to then compile successfully.
I've tried experimenting with trying to get rid of the minknow_api from the proto imports, however had no luck and only got more import issues during compilation. It seems some files have the same names for messages etc, which means I had to keep the minknow.somename as the package so I can thus distinguish in the files which imported values I wanted to access. I've also tried moving files into their own directories like instance.proto which has package minknow.instance would go inside of instance directory, but still no luck.
I was wondering if anyone could figure out how to get rid of the minknow_api out of my proto imports properly so that I won't get these import and output directory issues down the track?

Cannot compile resource for application manifest in C++ Builder 2006

I am trying to add the application manifest to a program built with C++Builder 2006, by following this article.
(The manifest is to obtain admin rights for my program, which contains "setup" in his name and so it triggers the “This program may not have installed correctly” warning).
I have the MyApp_Setup.exe.manifest in the project folder, along with the MyApp_Setup1.rc file, which is present in the project.
When i try to build, i get:
[RC Fatal Error] MyApp_Setup1.rc(1): File creation failed
What i'm doing wrong, or what should I do?
question edited 'cause i messed up the filenames and the output error didn't matched
Found the problem.
In the project options I always set an "_obj" output folder, but the resource compiler WANTS an existing "debug_build" folder to write the .res file.
It don't create the directory, hence the error in the file creation.
If i remove the "Obj" option, or once you have the "Debug_Build" folder present, everything compiles.

PyAIML not loading startup

I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.

Team City - File not found error - compilation error

My team city build is failing with error
" [Csc] CSC error CS2001: Source file
'Services\Entities\ModelNames.cs' could not be found
Thing is this .cs file is deleted from source contrl (TFS) and local machines when checked in. There is no piece of code using this class anywhere in the project. But I still keep getting this error. What can I try?
Make sure your TeamCity checkout or script checkout is correct. It seems like your building using old project file. Maybe the sub directories are checked out and not the root directory as well ?

Trouble to generate header file for JNI

I compiled HelloWorld.c successfully. I changed to the directory where HelloWorld.class is.
And I typed javah -jni HelloWorld in Terminal to get header file. I have the following error message. What is the problem? I am developing Android app using Mac OSX.
error: cannot access HelloWorld
bad class file: ./HelloWorld.class
class file contains wrong class: Test.HelloWorld
Please remove or make sure it appears in the correct subdirectory of the classpath.
com.sun.tools.javac.util.Abort
javadoc: error - fatal error
2 errors
I guess that your HelloWorld.class is located in a subfolder Test. You are not expected to be INSIDE that folder but in the ROOT folder for your compiled package(s). So go out of that Test folder and try again javah -jni Test.HelloWorld
BTW i don't understand how you could "compile your HelloWorld.c succesfuly" if you don't even have the header yet. But i am answering what have been asked.