PATH:
home
/
lab2454c
/
costbloc.com
/
vendor
/
razorpay
/
razorpay
/
tests
<?php namespace Razorpay\Tests; use Razorpay\Api\Request; class ItemTest extends TestCase { public function setUp(): void { parent::setUp(); } /** * Create item */ public function testcreate() { $data = $this->api->Item->create(array( "name" => "Book / English August", "description" => "An indian story, Booker prize winner.", "amount" => 20000, "currency" => "INR" )); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('id',$data->toArray())); } /** * Fetch all orders */ public function testAllItems() { $data = $this->api->Item->all(); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(is_array($data['items'])); } /** * Fetch particular item */ public function testfetchItem() { $item = $this->api->Item->create(array( "name" => "Book / English August", "description" => "An indian story, Booker prize winner.", "amount" => 20000, "currency" => "INR" )); $data = $this->api->Item->fetch($item->id); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array($item->id, $data->toArray())); } /** * Update item */ public function testUpdate() { $item = $this->api->Item->create(array( "name" => "Book / English August", "description" => "An indian story, Booker prize winner.", "amount" => 20000, "currency" => "INR" )); $data = $this->api->Item->fetch($item->id)->edit(array( "name" => "Book / English August", "description" => "An indian story, Booker prize winner.", "amount" => 20000, "currency" => "INR" )); $this->assertTrue(is_array($data->toArray())); } /** * Delete item */ public function testDelete() { $item = $this->api->Item->create(array( "name" => "Book / English August", "description" => "An indian story, Booker prize winner.", "amount" => 20000, "currency" => "INR" )); $data = $this->api->Item->fetch($item->id)->delete(); $this->assertTrue(is_array($data->toArray())); } }
[-] QrCodeTest.php
[edit]
[-] TestCase.php
[edit]
[-] AddonTest.php
[edit]
[-] OrdersTest.php
[edit]
[+]
..
[-] SignatureVerificationTest.php
[edit]
[-] TokenTest.php
[edit]
[-] PaperNachTest.php
[edit]
[-] UpiTest.php
[edit]
[-] RegisterNachTest.php
[edit]
[-] InvoiceTest.php
[edit]
[-] VirtualAccountTest.php
[edit]
[-] FundTest.php
[edit]
[-] RegisterEmandateTest.php
[edit]
[-] PaymentLinkTest.php
[edit]
[-] EmandateTest.php
[edit]
[-] CustomerTest.php
[edit]
[-] PaymentTest.php
[edit]
[-] ItemTest.php
[edit]
[-] PlanTest.php
[edit]
[-] SettlementTest.php
[edit]
[-] TransferTest.php
[edit]
[-] bootstrap.php
[edit]
[-] RefundTest.php
[edit]
[-] SubscriptionTest.php
[edit]