<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$
 */
 
  uses('net.xp_framework.tools.vm.unittest.migrate.AbstractRewriterTest');

  /**
   * Tests is_a() -> instanceof rewriting
   *
   * @purpose  Unit Test
   */
  class InstanceOfTest extends AbstractRewriterTest {

    /**
     * Tests is_a() when used with a variable and a string
     *
     * @access  public
     */
    #[@test]
    function variableAndString() {
      $this->assertRewritten('($a instanceof util.Date);', 'is_a($a, "Date");');
    }

    /**
     * Tests is_a() when used with a expression and a string
     *
     * @access  public
     */
    #[@test]
    function expressionAndString() {
      $this->assertRewritten('(get_class($this) instanceof util.Date);', 'is_a(get_class($this), "Date");');
    }
  }
?><commit_msg>- Rename assertRewritten() -> assertExpressionRewritten()<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */
 
  uses('net.xp_framework.tools.vm.unittest.migrate.AbstractRewriterTest');

  /**
   * Tests is_a() -> instanceof rewriting
   *
   * @purpose  Unit Test
   */
  class InstanceOfTest extends AbstractRewriterTest {

    /**
     * Tests is_a() when used with a variable and a string
     *
     * @access  public
     */
    #[@test]
    function variableAndString() {
      $this->assertExpressionRewritten('($a instanceof util.Date);', 'is_a($a, "Date");');
    }

    /**
     * Tests is_a() when used with a expression and a string
     *
     * @access  public
     */
    #[@test]
    function expressionAndString() {
      $this->assertExpressionRewritten('(get_class($this) instanceof util.Date);', 'is_a(get_class($this), "Date");');
    }
  }
?>
{'fraction_non_alphanumeric': 0.15442890442890442, 'fraction_numerical': 0.0, 'mean_word_length': 2.8070953436807096, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4828856', 'n_tokens_mistral': 569, 'n_tokens_neox': 543, 'n_words': 127}