<commit_before><?php
class FluentTest extends PHPUnit_Framework_TestCase
{
  public function testCreatingNewInstance()
  {
    new Pimf_Util_Fluent(array( 'name' => 'Lammy' ));
  }

  public function testUsingMagic()
  {
    $person = new Pimf_Util_Fluent();

    $person->name('Lammy')->age(25)->nullable();

    $this->assertSame('Lammy', $person->name);
    $this->assertSame(25, $person->age);
    $this->assertSame(null, $person->nullable);
  }
}<commit_msg>add test for Pimf_Util_Fluent accessing properties as array #php #framework<commit_after><?php
class FluentTest extends PHPUnit_Framework_TestCase
{
  public function testCreatingNewInstance()
  {
    new Pimf_Util_Fluent(array( 'name' => 'Lammy' ));
  }

  public function testUsingMagic()
  {
    $person = new Pimf_Util_Fluent();

    $person->name('Lammy')->age(25)->nullable();

    $this->assertSame('Lammy', $person->name);
    $this->assertSame(25, $person->age);
    $this->assertSame(null, $person->nullable);
  }

  public function testUsingAsArrayMagic()
  {
    $person = new Pimf_Util_Fluent();

    $person->name('Lammy')->age(25)->nullable();

    $this->assertSame('Lammy', $person['name']);
    $this->assertSame(25, $person['age']);
    $this->assertSame(null, $person['nullable']);
  }
}
{'fraction_non_alphanumeric': 0.17559055118110237, 'fraction_numerical': 0.009448818897637795, 'mean_word_length': 4.699551569506727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '3843339', 'n_tokens_mistral': 451, 'n_tokens_neox': 428, 'n_words': 72}