<commit_before><?php

require_once '/Users/reubano/Documents/Projects/csv2ofx/OFX.php';

/**
 * Test class for OFX.
 * Generated by PHPUnit on 2012-11-19 at 16:31:57.
 */
class OFXTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var OFX
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new OFX;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * Generated from @assert (array(array('Amount' => '$1,000.00'))) == array(array('Amount' => 1000.00)).
     *
     * @covers OFX::cleanAmounts
     */
    public function testCleanAmounts()
    {
        $this->assertEquals(
          array(array('Amount' => 1000.00)),
          $this->object->cleanAmounts(array(array('Amount' => '$1,000.00')))
        );
    }

    /**
     * Generated from @assert (array(array(array('Account Name' => 'account1'), array('Account Name' => 'account2')), array(array('Account Name' => 'account3'), array('Account Name' => 'account4')))) == array('account1', 'account3').
     *
     * @covers OFX::getAccounts
     */
    public function testGetAccounts()
    {
        $this->assertEquals(
          array('account1', 'account3'),
          $this->object->getAccounts(array(array(array('Account Name' => 'account1'), array('Account Name' => 'account2')), array(array('Account Name' => 'account3'), array('Account Name' => 'account4'))))
        );
    }

    /**
     * Generated from @assert (array('somecash', 'checking account', 'other'), array('Bank' => array('checking', 'savings'), 'Cash' => array('cash'))) == array('Cash', 'Bank', 'n/a').
     *
     * @covers OFX::getAccountTypes
     */
    public function testGetAccountTypes()
    {
        $this->assertEquals(
          array('Cash', 'Bank', 'n/a'),
          $this->object->getAccountTypes(array('somecash', 'checking account', 'other'), array('Bank' => array('checking', 'savings'), 'Cash' => array('cash')))
        );
    }

    /**
     * Generated from @assert (array(array(array('Account Name' => 'account1', 'Amount' => 200), array('Account Name' => 'account1', 'Amount' => 200), array('Account Name' => 'account1', 'Amount' => 200))), array('account1')) == array(array(array('Account Name' => 'account1', 'Amount' => 600))).
     *
     * @covers OFX::collapseSplits
     */
    public function testCollapseSplits()
    {
        $this->assertEquals(
          array(array(array('Account Name' => 'account1', 'Amount' => 600))),
          $this->object->collapseSplits(array(array(array('Account Name' => 'account1', 'Amount' => 200), array('Account Name' => 'account1', 'Amount' => 200), array('Account Name' => 'account1', 'Amount' => 200))), array('account1'))
        );
    }

    /**
     * Generated from @assert (array(array(array('Amount' => 350), array('Amount' => -400)), array(array('Amount' => 100), array('Amount' => -400), array('Amount' => 300)))) == array(400, 400).
     *
     * @covers OFX::getMaxSplitAmounts
     */
    public function testGetMaxSplitAmounts()
    {
        $this->assertEquals(
          array(400, 400),
          $this->object->getMaxSplitAmounts(array(array(array('Amount' => 350), array('Amount' => -400)), array(array('Amount' => 100), array('Amount' => -400), array('Amount' => 300))))
        );
    }

    /**
     * Generated from @assert (array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1'), array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))) == array(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1')), array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))).
     *
     * @covers OFX::makeSplits
     */
    public function testMakeSplits()
    {
        $this->assertEquals(
          array(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1')), array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))),
          $this->object->makeSplits(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1'), array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2')))
        );
    }

    /**
     * Generated from @assert (array('Transaction Type' => 'debit', 'Amount' => 1000.00, 'Date' => '06/12/10', 'Description' => 'payee', 'Original Description' => 'description', 'Notes' => 'notes', 'Category' => 'Checking', 'Account Name' => 'account')) == array('Amount' => '-1000', 'Payee' => 'payee', 'Date' => '06/12/10', 'Desc' => 'description notes', 'Id' => '<KEY>', 'CheckNum' => null, 'Type' => 'debit', 'SplitAccount' => 'Checking', 'SplitAccountId' => '195917574edc9b6bbeb5be9785b6a479').
     *
     * @covers OFX::getTransactionData
     */
    public function testGetTransactionData()
    {<commit_msg>Edit unit tests<commit_after><?php

require_once '/Users/reubano/Documents/Projects/csv2ofx/OFX.php';

/**
 * Test class for OFX.
 * Generated by PHPUnit on 2012-11-21 at 19:03:41.
 */
class OFXTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var OFX
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new OFX;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * Generated from @assert (array(array('Amount' => '$1,000.00'))) == array(array('Amount' => 1000.00)).
     *
     * @covers OFX::cleanAmounts
     */
    public function testCleanAmounts()
    {
        $this->assertEquals(
          array(array('Amount' => 1000.00)),
          $this->object->cleanAmounts(array(array('Amount' => '$1,000.00')))
        );
    }

    /**
     * Generated from @assert (array(array(array('Account Name' => 'account1'), array('Account Name' => 'account2')), array(array('Account Name' => 'account3'), array('Account Name' => 'account4')))) == array('accounts' => array('account1', 'account3'), 'keys' => array(0, 0)).
     *
     * @covers OFX::getAccounts
     */
    public function testGetAccounts()
    {
        $this->assertEquals(
          array('accounts' => array('account1', 'account3'), 'keys' => array(0, 0)),
          $this->object->getAccounts(array(array(array('Account Name' => 'account1'), array('Account Name' => 'account2')), array(array('Account Name' => 'account3'), array('Account Name' => 'account4'))))
        );
    }

    /**
     * Generated from @assert (array(array(array('Account Name' => 'account1', 'Amount' => -200), array('Account Name' => 'account2', 'Amount' => 200)), array(array('Account Name' => 'account3', 'Amount' => 400), array('Account Name' => 'account4', 'Amount' => -400))), array(200, 400)) == array('accounts' => array('account1', 'account3'), 'keys' => array(0, 0)).
     *
     * @covers OFX::getAccounts
     */
    public function testGetAccounts2()
    {
        $this->assertEquals(
          array('accounts' => array('account1', 'account3'), 'keys' => array(0, 0)),
          $this->object->getAccounts(array(array(array('Account Name' => 'account1', 'Amount' => -200), array('Account Name' => 'account2', 'Amount' => 200)), array(array('Account Name' => 'account3', 'Amount' => 400), array('Account Name' => 'account4', 'Amount' => -400))), array(200, 400))
        );
    }

    /**
     * Generated from @assert (array('somecash', 'checking account', 'other'), array('Bank' => array('checking', 'savings'), 'Cash' => array('cash'))) == array('Cash', 'Bank', 'n/a').
     *
     * @covers OFX::getAccountTypes
     */
    public function testGetAccountTypes()
    {
        $this->assertEquals(
          array('Cash', 'Bank', 'n/a'),
          $this->object->getAccountTypes(array('somecash', 'checking account', 'other'), array('Bank' => array('checking', 'savings'), 'Cash' => array('cash')))
        );
    }

    /**
     * Generated from @assert (array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400))) == array('Accounts Receivable', 'Sales').
     *
     * @covers OFX::getSplitAccounts
     */
    public function testGetSplitAccounts()
    {
        $this->assertEquals(
          array('Accounts Receivable', 'Sales'),
          $this->object->getSplitAccounts(array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400)))
        );
    }

    /**
     * Generated from @assert (array(array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400)), array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400))), array('Accounts Receivable')) == array(array(array('Account Name' => 'Accounts Receivable', 'Amount' => 500), array('Account Name' => 'Sales', 'Amount' => 400)), array(array('Account Name' => 'Accounts Receivable', 'Amount' => 500), array('Account Name' => 'Sales', 'Amount' => 400))).
     *
     * @covers OFX::collapseSplits
     */
    public function testCollapseSplits()
    {
        $this->assertEquals(
          array(array(array('Account Name' => 'Accounts Receivable', 'Amount' => 500), array('Account Name' => 'Sales', 'Amount' => 400)), array(array('Account Name' => 'Accounts Receivable', 'Amount' => 500), array('Account Name' => 'Sales', 'Amount' => 400))),
          $this->object->collapseSplits(array(array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400)), array(array('Account Name' => 'Accounts Receivable', 'Amount' => 200), array('Account Name' => 'Accounts Receivable', 'Amount' => 300), array('Account Name' => 'Sales', 'Amount' => 400))), array('Accounts Receivable'))
        );
    }

    /**
     * Generated from @assert (array(array(array('Amount' => 350), array('Amount' => -400)), array(array('Amount' => 100), array('Amount' => -400), array('Amount' => 300)))) == array(400, 400).
     *
     * @covers OFX::getMaxSplitAmounts
     */
    public function testGetMaxSplitAmounts()
    {
        $this->assertEquals(
          array(400, 400),
          $this->object->getMaxSplitAmounts(array(array(array('Amount' => 350), array('Amount' => -400)), array(array('Amount' => 100), array('Amount' => -400), array('Amount' => 300))))
        );
    }

    /**
     * Generated from @assert (array(array(array('Amount' => 100), array('Amount' => -100)), array(array('Amount' => -300), array('Amount' => 200), array('Amount' => 100)))) == true.
     *
     * @covers OFX::verifySplits
     */
    public function testVerifySplits()
    {
        $this->assertTrue(
          $this->object->verifySplits(array(array(array('Amount' => 100), array('Amount' => -100)), array(array('Amount' => -300), array('Amount' => 200), array('Amount' => 100))))
        );
    }

    /**
     * Generated from @assert (array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1'), array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))) == array(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1')), array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))).
     *
     * @covers OFX::makeSplits
     */
    public function testMakeSplits()
    {
        $this->assertEquals(
          array(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1')), array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2'))),
          $this->object->makeSplits(array(array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account1'), array('Amount' => 1,000.00, 'Date' => '06/12/10', 'Category' => 'Checking', 'Account Name' => 'account2')))
        );
    }

    /**
     * Generated from @assert (array('Transaction Type' => 'debit', 'Amount' => 1000.00, 'Date' => '06/12/10', 'Description' => 'payee', 'Original Description' => 'description', 'Notes' => 'notes', 'Category' => 'Checking', 'Account Name' => 'account')) == array('Amount' => '-1000', 'Payee' => 'payee', 'Date' => '06/12/10', 'Desc' => 'description notes', 'Id' => '4fe86d9de995225b174fb3116ca6b1f4', 'CheckNum' => null, 'Type' => 'debit', 'SplitAccount' => 'Checking', 'SplitAccountId' => '195917574edc9b6bbeb5be9785b6a479').
     *
     * @covers OFX::getTransactionData
     */
    public function testGetTransactionData()
    {
{'fraction_non_alphanumeric': 0.21682160895981262, 'fraction_numerical': 0.05102115511309568, 'mean_word_length': 3.58918374202217, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 303, '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': '5057133', 'n_tokens_mistral': 4849, 'n_tokens_neox': 4282, 'n_words': 962}