<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('unittest.TestCase');

  /**
   * Test the XP reflection API's Modifiers utility class
   *
   * @see      xp://lang.reflect.Modifiers
   * @purpose  Testcase
   */
  class ModifiersTest extends TestCase {

    /**
     * Tests the public modifier should be the default
     *
     */
    #[@test]
    public function defaultModifier() {
      $this->assertTrue(Modifiers::isPublic(0));
    }

    /**
     * Tests the public modifier should be the default
     *
     */
    #[@test]
    public function defaultModifierString() {
      $this->assertEquals('public', Modifiers::stringOf(0));
    }

    /**
     * Tests the public modifier
     *
     */
    #[@test]
    public function publicModifier() {
      $this->assertTrue(Modifiers::isPublic(MODIFIER_PUBLIC));
    }

    /**
     * Tests the public modifier
     *
     */
    #[@test]
    public function publicModifierString() {
      $this->assertEquals('public', Modifiers::stringOf(MODIFIER_PUBLIC));
    }

    /**
     * Tests the private modifier
     *
     */
    #[@test]
    public function privateModifier() {
      $this->assertTrue(Modifiers::isPrivate(MODIFIER_PRIVATE));
    }

    /**
     * Tests the private modifier
     *
     */
    #[@test]
    public function privateModifierString() {
      $this->assertEquals('private', Modifiers::stringOf(MODIFIER_PRIVATE));
    }

    /**
     * Tests the protected modifier
     *
     */
    #[@test]
    public function protectedModifier() {
      $this->assertTrue(Modifiers::isProtected(MODIFIER_PROTECTED));
    }

    /**
     * Tests the protected modifier
     *
     */
    #[@test]
    public function protectedModifierString() {
      $this->assertEquals('protected', Modifiers::stringOf(MODIFIER_PROTECTED));
    }

    /**
     * Tests the abstract modifier
     *
     */
    #[@test]
    public function abstractModifier() {
      $this->assertTrue(Modifiers::isAbstract(MODIFIER_ABSTRACT));
    }

    /**
     * Tests the abstract modifier
     *
     */
    #[@test]
    public function abstractModifierString() {
      $this->assertEquals('public abstract', Modifiers::stringOf(MODIFIER_ABSTRACT));
    }

    /**
     * Tests the final modifier
     *
     */
    #[@test]
    public function finalModifier() {
      $this->assertTrue(Modifiers::isFinal(MODIFIER_FINAL));
    }

    /**
     * Tests the final modifier
     *
     */
    #[@test]
    public function finalModifierString() {
      $this->assertEquals('public final', Modifiers::stringOf(MODIFIER_FINAL));
    }

    /**
     * Tests the static modifier
     *
     */
    #[@test]
    public function staticModifier() {
      $this->assertTrue(Modifiers::isStatic(MODIFIER_STATIC));
    }

    /**
     * Tests the static modifier
     *
     */
    #[@test]
    public function staticModifierString() {
      $this->assertEquals('public static', Modifiers::stringOf(MODIFIER_STATIC));
    }
  }
?><commit_msg>- Add tests for namesOf() method<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('unittest.TestCase');

  /**
   * Test the XP reflection API's Modifiers utility class
   *
   * @see      xp://lang.reflect.Modifiers
   * @purpose  Testcase
   */
  class ModifiersTest extends TestCase {

    /**
     * Tests the public modifier should be the default
     *
     */
    #[@test]
    public function defaultModifier() {
      $this->assertTrue(Modifiers::isPublic(0));
    }

    /**
     * Tests the public modifier should be the default
     *
     */
    #[@test]
    public function defaultModifierString() {
      $this->assertEquals('public', Modifiers::stringOf(0));
    }

    /**
     * Tests the public modifier should be the default
     *
     */
    #[@test]
    public function defaultModifierNames() {
      $this->assertEquals(array('public'), Modifiers::namesOf(0));
    }

    /**
     * Tests the public modifier
     *
     */
    #[@test]
    public function publicModifier() {
      $this->assertTrue(Modifiers::isPublic(MODIFIER_PUBLIC));
    }

    /**
     * Tests the public modifier
     *
     */
    #[@test]
    public function publicModifierString() {
      $this->assertEquals('public', Modifiers::stringOf(MODIFIER_PUBLIC));
    }

    /**
     * Tests the public modifier
     *
     */
    #[@test]
    public function publicModifierNames() {
      $this->assertEquals(array('public'), Modifiers::namesOf(MODIFIER_PUBLIC));
    }

    /**
     * Tests the private modifier
     *
     */
    #[@test]
    public function privateModifier() {
      $this->assertTrue(Modifiers::isPrivate(MODIFIER_PRIVATE));
    }

    /**
     * Tests the private modifier
     *
     */
    #[@test]
    public function privateModifierString() {
      $this->assertEquals('private', Modifiers::stringOf(MODIFIER_PRIVATE));
    }

    /**
     * Tests the private modifier
     *
     */
    #[@test]
    public function privateModifierNames() {
      $this->assertEquals(array('private'), Modifiers::namesOf(MODIFIER_PRIVATE));
    }

    /**
     * Tests the protected modifier
     *
     */
    #[@test]
    public function protectedModifier() {
      $this->assertTrue(Modifiers::isProtected(MODIFIER_PROTECTED));
    }

    /**
     * Tests the protected modifier
     *
     */
    #[@test]
    public function protectedModifierString() {
      $this->assertEquals('protected', Modifiers::stringOf(MODIFIER_PROTECTED));
    }

    /**
     * Tests the protected modifier
     *
     */
    #[@test]
    public function protectedModifierNames() {
      $this->assertEquals(array('protected'), Modifiers::namesOf(MODIFIER_PROTECTED));
    }

    /**
     * Tests the abstract modifier
     *
     */
    #[@test]
    public function abstractModifier() {
      $this->assertTrue(Modifiers::isAbstract(MODIFIER_ABSTRACT));
    }

    /**
     * Tests the abstract modifier
     *
     */
    #[@test]
    public function abstractModifierString() {
      $this->assertEquals('public abstract', Modifiers::stringOf(MODIFIER_ABSTRACT));
    }

    /**
     * Tests the abstract modifier
     *
     */
    #[@test]
    public function abstractModifierNames() {
      $this->assertEquals(array('public', 'abstract'), Modifiers::namesOf(MODIFIER_ABSTRACT));
    }

    /**
     * Tests the final modifier
     *
     */
    #[@test]
    public function finalModifier() {
      $this->assertTrue(Modifiers::isFinal(MODIFIER_FINAL));
    }

    /**
     * Tests the final modifier
     *
     */
    #[@test]
    public function finalModifierString() {
      $this->assertEquals('public final', Modifiers::stringOf(MODIFIER_FINAL));
    }

    /**
     * Tests the final modifier
     *
     */
    #[@test]
    public function finalModifierNames() {
      $this->assertEquals(array('public', 'final'), Modifiers::namesOf(MODIFIER_FINAL));
    }

    /**
     * Tests the static modifier
     *
     */
    #[@test]
    public function staticModifier() {
      $this->assertTrue(Modifiers::isStatic(MODIFIER_STATIC));
    }

    /**
     * Tests the static modifier
     *
     */
    #[@test]
    public function staticModifierString() {
      $this->assertEquals('public static', Modifiers::stringOf(MODIFIER_STATIC));
    }

    /**
     * Tests the static modifier
     *
     */
    #[@test]
    public function staticModifierNames() {
      $this->assertEquals(array('public', 'static'), Modifiers::namesOf(MODIFIER_STATIC));
    }
  }
?>
{'fraction_non_alphanumeric': 0.13918144247433675, 'fraction_numerical': 0.0006665777896280496, 'mean_word_length': 2.4365551992670635, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '7252707', 'n_tokens_mistral': 2250, 'n_tokens_neox': 2198, 'n_words': 424}