<commit_before><?php
/**
 * PHP version 5.6
 *
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */
namespace Ewallet\Accounts;

use Eris\Generator;
use Eris\TestTrait;
use EwalletTestsBridge\MembersBuilder;
use Money\Money;
use PHPUnit_Framework_TestCase as TestCase;

class MemberTest extends TestCase
{
    use TestTrait;

    /** @test */
    function giver_balance_should_decrease_after_funds_have_been_transferred()
    {
        $this
            ->forAll(Generator\nat(10000))
            ->then(function($amount) {
                $aMember = MembersBuilder::aMember();
                $fromMember = $aMember->withBalance(10000)->build();
                $toMember = MembersBuilder::aMember()->build();
                $fromMember->transfer(Money::MXN($amount), $toMember);
                $currentBalance = $fromMember->information()->accountBalance()->getAmount();
                $this->assertLessThan(
                    10000,
                    $currentBalance,
                    "{$currentBalance} > 10000, {$amount} transferred"
                );
            });
        ;
    }

    /** @test */
    function beneficiary_balance_should_increase_after_funds_have_been_transferred()
    {
        $this
            ->forAll(Generator\nat(10000))
            ->then(function($amount) {
                $aMember = MembersBuilder::aMember();
                $fromMember = $aMember->withBalance(10000)->build();
                $aMember = MembersBuilder::aMember();
                $toMember = $aMember->withBalance(5000)->build();
                $fromMember->transfer(Money::MXN($amount), $toMember);
                $currentBalance = $toMember->information()->accountBalance()->getAmount();
                $this->assertGreaterThan(
                    5000,
                    $currentBalance,
                    "{$currentBalance} < 5000, {$amount} transferred"
                );
            });
        ;
    }
}<commit_msg>Fix range in property-based tests.<commit_after><?php
/**
 * PHP version 5.6
 *
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */
namespace Ewallet\Accounts;

use Eris\Generator;
use Eris\TestTrait;
use EwalletTestsBridge\MembersBuilder;
use Money\Money;
use PHPUnit_Framework_TestCase as TestCase;

class MemberTest extends TestCase
{
    use TestTrait;

    /** @test */
    function giver_balance_should_decrease_after_funds_have_been_transferred()
    {
        $this
            ->forAll(Generator\int(1, 10000))
            ->then(function($amount) {
                $aMember = MembersBuilder::aMember();
                $fromMember = $aMember->withBalance(10000)->build();
                $toMember = MembersBuilder::aMember()->build();
                $fromMember->transfer(Money::MXN($amount), $toMember);
                $currentBalance = $fromMember->information()->accountBalance()->getAmount();
                $this->assertLessThan(
                    10000,
                    $currentBalance,
                    "{$currentBalance} > 10000, {$amount} transferred"
                );
            });
        ;
    }

    /** @test */
    function beneficiary_balance_should_increase_after_funds_have_been_transferred()
    {
        $this
            ->forAll(Generator\int(1, 10000))
            ->then(function($amount) {
                $aMember = MembersBuilder::aMember();
                $fromMember = $aMember->withBalance(10000)->build();
                $aMember = MembersBuilder::aMember();
                $toMember = $aMember->withBalance(5000)->build();
                $fromMember->transfer(Money::MXN($amount), $toMember);
                $currentBalance = $toMember->information()->accountBalance()->getAmount();
                $this->assertGreaterThan(
                    5000,
                    $currentBalance,
                    "{$currentBalance} < 5000, {$amount} transferred"
                );
            });
        ;
    }
}
{'fraction_non_alphanumeric': 0.12558947629684786, 'fraction_numerical': 0.022338049143708117, 'mean_word_length': 2.0007446016381234, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4031313', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1041, 'n_words': 186}