<commit_before><?php namespace net\xp_framework\unittest\logging;

use unittest\TestCase;
use util\log\Appender;
use util\log\LogCategory;
use util\log\LoggingEvent;
use util\log\layout\PatternLayout;
use util\collections\Vector;

/**
 * TestCase
 *
 * @see      xp://util.log.Appender
 */
class LogAppenderTest extends TestCase {
  protected $fixture= null;
  protected $events= null;

  /**
   * Sets up test case
   */
  public function setUp() {
    $this->events= create('new util.collections.Vector<string>()');
    $appender= newinstance(Appender::class, [$this->events], [
      'events' => null,
      '__construct' => function($events) { $this->events= $events; },
      'append' => function(LoggingEvent $event) {
        $this->events[]= $this->layout->format($event);<commit_msg>Refactor code to work without util.collections APIs<commit_after><?php namespace net\xp_framework\unittest\logging;

use unittest\TestCase;
use util\log\Appender;
use util\log\LogCategory;
use util\log\LoggingEvent;
use util\log\layout\PatternLayout;
use util\collections\Vector;

/**
 * TestCase
 *
 * @see      xp://util.log.Appender
 */
class LogAppenderTest extends TestCase {
  protected $fixture= null;
  public $events= [];

  /**
   * Sets up test case
   */
  public function setUp() {
    $appender= newinstance(Appender::class, [$this], [
      'test' => null,
      '__construct' => function($test) { $this->test= $test; },
      'append' => function(LoggingEvent $event) {
        $this->test->events[]= $this->layout->format($event);
{'fraction_non_alphanumeric': 0.15984405458089668, 'fraction_numerical': 0.0, 'mean_word_length': 3.8734177215189876, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 21, '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': '7661977', 'n_tokens_mistral': 497, 'n_tokens_neox': 491, 'n_words': 105}