AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.216.192
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/hering/vendor/braintree/braintree_php/tests/integration/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/hering/vendor/braintree/braintree_php/tests/integration/TextNodeTest.php
<?php
namespace Test\Integration;

require_once dirname(__DIR__) . '/Setup.php';

use Test;
use Test\Setup;
use Braintree;

class TextNodeTest extends Setup
{
    public function testIs()
    {
        $creditCard = SubscriptionHelper::createCreditCard();
        $triallessPlan = SubscriptionHelper::triallessPlan();
        $trialPlan = SubscriptionHelper::trialPlan();

        $trialSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $trialPlan['id'],
            'price' => '5',
        ])->subscription;

        $triallessSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $triallessPlan['id'],
            'price' => '5',
        ])->subscription;

        $collection = Braintree\Subscription::search([
            Braintree\SubscriptionSearch::planId()->is("integration_trial_plan"),
            Braintree\SubscriptionSearch::price()->is('5')
        ]);

        $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
        $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
    }

    public function testIsNot()
    {
        $creditCard = SubscriptionHelper::createCreditCard();
        $triallessPlan = SubscriptionHelper::triallessPlan();
        $trialPlan = SubscriptionHelper::trialPlan();

        $trialSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $trialPlan['id'],
            'price' => '6',
        ])->subscription;

        $triallessSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $triallessPlan['id'],
            'price' => '6'
        ])->subscription;

        $collection = Braintree\Subscription::search([
            Braintree\SubscriptionSearch::planId()->isNot("integration_trialless_plan"),
            Braintree\SubscriptionSearch::price()->is("6")
        ]);

        $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
        $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
    }

    public function testStartsWith()
    {
        $creditCard = SubscriptionHelper::createCreditCard();
        $triallessPlan = SubscriptionHelper::triallessPlan();
        $trialPlan = SubscriptionHelper::trialPlan();

        $trialSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $trialPlan['id'],
            'price' => '7',
        ])->subscription;

        $triallessSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $triallessPlan['id'],
            'price' => '7',
        ])->subscription;

        $collection = Braintree\Subscription::search([
            Braintree\SubscriptionSearch::planId()->startsWith("integration_trial_pl"),
            Braintree\SubscriptionSearch::price()->is('7')
        ]);

        $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
        $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
    }

    public function testEndsWith()
    {
        $creditCard = SubscriptionHelper::createCreditCard();
        $triallessPlan = SubscriptionHelper::triallessPlan();
        $trialPlan = SubscriptionHelper::trialPlan();

        $trialSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $trialPlan['id'],
            'price' => '8'
        ])->subscription;

        $triallessSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $triallessPlan['id'],
            'price' => '8'
        ])->subscription;

        $collection = Braintree\Subscription::search([
            Braintree\SubscriptionSearch::planId()->endsWith("rial_plan"),
            Braintree\SubscriptionSearch::price()->is("8")
        ]);

        $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
        $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
    }


    public function testContains()
    {
        $creditCard = SubscriptionHelper::createCreditCard();
        $triallessPlan = SubscriptionHelper::triallessPlan();
        $trialPlan = SubscriptionHelper::trialPlan();

        $trialSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $trialPlan['id'],
            'price' => '9'
        ])->subscription;

        $triallessSubscription = Braintree\Subscription::create([
            'paymentMethodToken' => $creditCard->token,
            'planId' => $triallessPlan['id'],
            'price' => '9'
        ])->subscription;

        $collection = Braintree\Subscription::search([
            Braintree\SubscriptionSearch::planId()->contains("ration_trial_pl"),
            Braintree\SubscriptionSearch::price()->is("9")
        ]);

        $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
        $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
    }
}

Anon7 - 2022
AnonSec Team