Setting up VisualPHPUnit with CakePHP3 - cakephp-3.0

It looks like the web test runner test.php was removed in CakePHP3 - and from what I can find, the suggestion to replace it is https://github.com/NSinopoli/VisualPHPUnit.
(source: https://github.com/cakephp/app/issues/12)
I am having trouble getting VisualPHPUnit set up so that it properly runs the tests in CakePHP3, and I can't seem to find the tutorial section that was intended to be written as mentioned in the above link.
Can anyone provide a tutorial, or pointers/suggestions for setting up VisualPHPUnit alongside a cakephp3 app, or as a plugin?

Related

Tauri is not showing the expected results and the build seems to be pretty broken

I've been trying to convert my website into a project with Tauri for the past 3 days and I'm not getting any intended results even though I followed the tutorial on Tauri Documentation countless times.
When I run npm create tauri-app to create a starting template for my project, I should be able to get a result like the following.
https://www.freecodecamp.org/news/content/images/2022/10/Screenshot-from-2022-10-11-14-03-45.png
(Copyrights go to relevant authors)
But I always get something like this.
My build
After I got this problem I emptied my project folder, uninstalled npm and tauri-cli reinstalled it again, and followed the tutorial but still get no good results. I continued the same procedure more than ten times in a row. I also tried using other package managers which were available but didn't work for me.
Then I checked the src file within my project folder which contained the related html, css and javascript files for the demo and opened index.html. It also looked like this.
Demo HTML files viewed through a browser
Browser console had following issues and I have no idea what's going with my Tauri project all the time.
Issues in the browser console
I swifted through the official Tauri GitHub resp and found no any issue like this is filed by somebody. I really apprciate if any possible solution is given regarding this issue.
Tauri CLI: #tauri-apps/cli#1.2.2
OS: Windows 11 Home Single Langauge 10.0.22623 Build 22623
Both npm and Node.js are up-to-date.

Wordpress JSON API returns normal site page in html. How do I get it to give me JSON like it's supposed to

For example, entering http://mywordpresswebsite.example.com/?json=1 into the browser loads the main site html, the same as omitting the json querystring variable: http://mywordpresswebsite.example.com/
The JSON API is activated. I have tried reactivating and deactivating, checking .htaccess file settings, and deactivating all other plugins. None of those have made much difference so far.
TIA
I had the same problem with my localhost test page and was wondering, why my route worked last week and was not accessible this week.
Short explanation
After some tests and a lot of frustration, I was able to use the REST API Route again by following the wordpress documentation about routes-vs-endpoints with “Pretty Permalinks” and “Ugly” Permalinks
Longer explanation
I guess in my case it was based on the reinstall of my MySQL Database. By installing the new database, my previous setup has been reset to the wordpress standard installation with permalinks as "plain", which is an "ugly" permalink. That's the reason, why the answer of Mattygabe work for me after the reinstall of the database.
But with this solution, I had a problem with my filter value and therefore I found the solution with "pretty premalinks" and changed my permalinks to "Month and name", as shown in the picture. After this change, I could access my REST API via the desired route.
There could be also some difficulties with REST APIs related to the following examples:
using "wp" within the REST route
if you work on plugins, which should be shared, keep on mind that some plugins may restrict REST Access, e.g. iThemes Security
I'm likely doing it wrong, but when I form my requests for a Wordpress installation at http://www.example.com/ like this:
http://www.example.com/index.php?rest_route=/my/rest/route/here
I end up getting proper responses back.
I had a heck of a time figuring this out and ended up grokking a URL formatted like that in the HTML returned to me. I was expecting to make requests as http://www.example.com/wp_json/wp/v2/my/rest/route/here , but I only got HTML responses.
(FWIW, I am reposting this on all similar questions on the StackExchange network. Admins/mods - if this is against the rules or seen as rep spamming, feel free to take it down. Was hoping to help anyone else hitting the same issue I am, and to also learn what it is I've done wrong and why.)
Ok, so the new endpoint for Wordpress 4.7 is mywordpresswebsite.example.com/index.php/wp-json. It's part of Wordpress Core as of 4.7 and not a plugin anymore, there's nothing to be activated. Thank you, Mark Kaplun.
I also experienced this issue. I did install the WP API plugin and then realized I didn't need it so I deactivated it and deleted it. Afterwards I tried a GET request to https://example.com/wp-json/wp/v2/posts and received the HTML of my wordpress site.
To fix this I ended up deactivating all plugins and then I started receiving the JSON response from https://example.com/wp-json/wp/v2/posts so I stepped through each plugin reactivating and in the end all my plugins are active and the endpoint is responding with JSON.
I changed Permalinks (Settings => Permalinks)
I had an issue returning html page instead of JSON response on Wordpress 5.3 and I got resolved when I changed the Permalink as Post name from plain

Yeoman CRUD Generator not working on MEAN.js

Following the instructions on the MEAN.js website, I create a new site and attempt to create a new CRUD using yeoman generator. my command is as follows
$ yo meanjs:crud-module meal
Everything seems to be created correctly in the modules folder, and when I go tho the site, and attempt to create a new "meal" everything seems to work fine until I hit submit. The browser throws the following error
http://localhost:3000/meals/api/meals 404 (Not Found)
Am I missing a step in the setup? is there something additional I need to do to get CRUD to work.
There is something wrong with your routing, check your client/config/routes and server/routes file. The URL should be:
http://localhost:3000/api/meals
without the first meals after 3000. That's why it is a 404.
Hope this helps, if you cant find the problem add some code.
Just put a forward slash(/) in front of api in resource service.
/api/meals instead of api/meals

Assign HTML IDs with SmartGWT

I asked some questions about the scLocators, but I still don't manage to get something working with selenium. So there is an idea :
"How can I say to smartGwt : Attribute an ID in HTML".
I tried ensureDebugId("myId") but I don't know why, in my webapp I can't even find this ID.
I tried setId("myId") but it's the same, I can't see it in the HTML code generated. I'm totally lost in this project. Can someone help me ? :/
=> Using : maven, selenium web driver (htmlunit), gwt, smartgwt.
=> For : Unit testing client side of a web app.
Any help is Appreciated.
This approach is a dead end, it will not work.
Go back to the Automated Testing overview in SmartGWT's JavaDoc, and the Selenium user-guide.html in the SDK (in the "selenium" folder).
If you're having trouble with Selenium:
consider getting a 3.1d build from smartclient.com/builds since we've added yet more documentation since the 3.0 release
ask questions about the Selenium approach, because again the approach you're trying now won't work

How to configure Netbeans code entry point when you use mod-rewriting

I am developing a website in PHP and I am using mod-rewrite rules. I want to use the Netbeans Run Configuration (under project properties) to set code entry points that looks like http://project/news or http://project/user/12
It seems Netbeans have a problem with this and needs an entry point to a physical file like http://project/user.php?id=12
Has anyone found a good way to work around this?
I see your question is a bit old, but since it has no answer, I will give you one.
What I did to solve the problem, was to give netbeans what it wants in terms of a valid physical file, but provide my controller (index.php in this case) with the 'data' to act correctly. I pass this data using a query parameter. Using your example of project being the web site domain and user/12 as the URL, use the following in the NetBeans Run Configuration and arguments boxes. netbeans does not need the ? as it inserts that automatically, see the complete url below the input boxes
Project URL: http://project
Index File: index.php *(put your controller name here)*
Arguments: url=user/12
http://project/index.php?url=user/12
Then in your controller (index.php in this example), test for the url query param and if it exists parse it instead of the actual Server Request, as you would do normally.
I also do not want the above URL to be publically accessible. So, by using an IS_DEVELOPER define, which is true only for configured developer IP addresses, I can control who has access that special url.
If you are trying to debug specific pages, alternatively, you can set the NetBeans run configuration to:
http://project/
and debug your project, but you must run through your home page once and since the debugger is now active, just navigate to http://project/user/12 in your browser and NetBeans will debug at that entry point. I found passing through my home page every time a pain, so I use the technique above.
Hopefully that provides enough insight to work with your project. It has worked good for me and if you need more detail, just ask.
EDIT: Also, one can make the Run Configuration Project URL the complete url http://project/user/12 and leave the Index File and Arguments blank and that works too without any special code in controller. (tested in NetBeans 7.1). I think I will start using this method.