473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Phake Framework and Stripe

omerbutt
638 Contributor
i have a situation where i have to test the functionality of my site's user subscriptions on stripe. i have to do integration testing for the cancel plans functionality on my site using php unit and php-facebook-webdrivers, according to my knowledge it is not a good practice to create users on stripe from within my test cases, i heard the term mocking, what it does that it stubs the function and returns whatever you want to return for any method inside a class which is mocked, so i decided that when i will mock the
Expand|Select|Wrap|Line Numbers
  1. Stripe_Subscription::cancel()
method to return my desired response rather than sending the call to stripe, i found the Phake php framework Phake which is used for this purpose.

But i cant get it to work with stripe calls, may be there is a possibility that i havent understood the concept correctly, they have provided example there but it works only with the interface class not the normal classes, can anyone tell me how to mock a simple class or if it is possible, because i cant find any community forum for Phake and it is really hard as it is the first time i am working on any such thing , i can provide my code also if required.

regards,

omer aslam
Apr 12 '15 #1
2 1585
Dormilich
8,658 Recognized Expert Moderator Expert
i found the Phake php framework Phake which is used for this purpose.
if you use PHPUnit for testing, that brings its own mocking/stubbing, so there’s no need to use something external.

otherwise it depends on what you use for unit testing.
Apr 13 '15 #2
omerbutt
638 Contributor
Thanks for the reply dormilich, yes you are right about hte mocking in PHPunit , but it appears to be that stripe has not yet supported to mock its methods , it works purely on static methods and calls , and there is no way yet that we could mock it yet
regards,
Omer Aslam
May 2 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kevin McDaniel | last post by:
I was wondering if anyone has heard of problems with the Export utility writing dump files on stripe-sets. I'm not sure if the stripe-set is configured correctly or not, but everytime I place my...
1
by: Jordan Peterson | last post by:
I'm trying to put a vertical blue stripe with a black border on this page that will remain colored even if the page is scrolled in the UA. http://maba.org/new/homeproducts/ As you can see, the...
2
by: xixi | last post by:
hi, i would like to choose dms type tablespace for the user data , the server is db2 udb v8.1 on windows 64 bit, the volume created is use stripe type, so it will cross the data on two different...
1
by: Erik Hendrix | last post by:
Hi, I have some questions related to stripe sets that I'm hoping someone here can answer. 1) What happens to stripe sets when doing a database restore? Do they stay as is? 2) What happens...
2
by: p175 | last post by:
Hi folks, I've tried reading just about every post I can on raid stiping / extent size etc and I'm just getting myself more confused than ever. Here's my situation. On a Windows Server 2000...
3
by: Frank | last post by:
I'm trying to access my database of records via a mag stripe reader. I've created a querry that prompts me to enter a number. I thought that I might just swipe the mag stripe and the appropriate...
7
by: Frank.Sebesta | last post by:
I have a wedge mag stripe reader that I swipe when ask to input information in a query. How do I filter the unwanted characters. Apparently there are two mag stripes that are read every time I...
8
by: Tom Warren | last post by:
I've ordered a mag stripe reader for Driver's Licenses but I want to get a jump on raw data parsing. I have the stdAAMVADLIDCardSpecs_092003.pdf which defines the structure of the raw data, but I...
5
by: Mark A | last post by:
I have an OLTP database that has a tablespace that will start out at about 1 TB, but may grow to 75 TB's in size over the next 5 years. When I add new containers (on a new mount point), I want to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.