testbed

Is there any way to test PHP locally without installing a server?

夙愿已清 提交于 2019-11-29 21:22:54
I'm looking for something like http://phpfiddle.org/ , but completely local. I don't want to commit to installing something as complex as Apache, then PHP on top of that, just to try out code when I'm offline. Is there anything that can run PHP 5.5 on the local machine without installing an entire server underneath it? Eugen Dimboiu There's no need for a server if using PHP 5.5+ - it has a built-in server ( http://www.php.net/manual/en/features.commandline.webserver.php ) Just use: $ cd ~/public_html $ php -S localhost:8000 Attila Fulop As a minimalistic solution, on the command line you can

Google App Engine set up a user when using testbed

与世无争的帅哥 提交于 2019-11-29 05:57:42
I'm using the GAE testbed service and when I run users.get_current_user() I get None i.e. >>> import sys >>> sys.path.append("/usr/local/google_appengine") # for Mac OS X >>> from google.appengine.api import users >>> from google.appengine.ext import testbed >>> testbed = testbed.Testbed() >>> testbed.activate() >>> testbed.init_user_stub() >>> users.get_current_user() == None True This is the expected result. However, I'd like to log in a fake user when running some of my unit tests. If it's possible (and I expect it would be), how can one log a user in when running testbed from the command

Angular 2 TestBed with mocks

∥☆過路亽.° 提交于 2019-11-28 22:31:43
问题 I am trying to test a component which uses another service. And I want to isolate the component by providing a mock for the service. Before RC5 I can simply use addproviders which is now deprecated and will be removed by the next RC. Instead I have to use the TestBed . When I provide the mock angular for some reason keep looking for the services that the mock depends on. And throws a DI exception . When I provide all the dependencies the test works but I don't want to repeat myself for each

Angular 4 Unit Tests (TestBed) extremely slow

痞子三分冷 提交于 2019-11-28 20:32:23
I have some unit tests using Angular TestBed. Even if the tests are very simple, they run extremely slow (on avarage 1 test assetion per second). Even after re-reading Angular documentation, I could not find the reason of such a bad perfomance. Isolated tests, not using TestBed, run in a fraction of second. UnitTest import { Component } from "@angular/core"; import { ComponentFixture, TestBed, async } from "@angular/core/testing"; import { By } from "@angular/platform-browser"; import { DebugElement } from "@angular/core"; import { DynamicFormDropdownComponent } from "./dynamicFormDropdown

Is there any way to test PHP locally without installing a server?

一世执手 提交于 2019-11-28 17:02:52
问题 I'm looking for something like http://phpfiddle.org/, but completely local. I don't want to commit to installing something as complex as Apache, then PHP on top of that, just to try out code when I'm offline. Is there anything that can run PHP 5.5 on the local machine without installing an entire server underneath it? 回答1: There's no need for a server if using PHP 5.5+ - it has a built-in server (http://www.php.net/manual/en/features.commandline.webserver.php) Just use: $ cd ~/public_html $

Google App Engine set up a user when using testbed

筅森魡賤 提交于 2019-11-27 23:46:47
问题 I'm using the GAE testbed service and when I run users.get_current_user() I get None i.e. >>> import sys >>> sys.path.append("/usr/local/google_appengine") # for Mac OS X >>> from google.appengine.api import users >>> from google.appengine.ext import testbed >>> testbed = testbed.Testbed() >>> testbed.activate() >>> testbed.init_user_stub() >>> users.get_current_user() == None True This is the expected result. However, I'd like to log in a fake user when running some of my unit tests. If it's