473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Phake Framework and Stripe

omerbutt
638 512MB
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 1583
Dormilich
8,658 Expert Mod 8TB
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 512MB
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.