title: Call a PHP Method from another class
body: <p>This has definitely been answered more then once. But I don't get it for my case.</p>
  
  <p>So I am writing browser-test for a part of our projekt.</p>
  
  <p>The function is, that there are users, that can login and other that are not allowed. So I wrote a 2 tests. TestA. tries to login without permissions and I check if the pop-up "there went something wrong" is visible. The other TestB is a registrated user. I check if he can reach the "shop" page. </p>
  
  <p>So I wrote a Method in the Class LoginPage.php </p>
  
  <p>class LoginPage.php</p>
  
  <pre><code> public function guiLoginUser(Browser $browser)
      {
          $browser-&gt;type('#email', 'normal.user______@hey.ch')
              -&gt;type('#password', 'ThisCanBeWhatever2')
              -&gt;click('#login');
  
      }
  
      public function guiLoginNoUser(Browser $browser)
      {
          $browser-&gt;type('#email', 'not.a.user______@nouser')
              -&gt;type('#password', 'ThisCanBeWhatever')
              -&gt;click('#login');
  </code></pre>
  
  <p>As of now our project dose not check the password, as we do not have access to the Database.</p>
  
  <p>This class contains the testA and testB. I will only be showing test B as the testA is the more or less the same, just using another emai.</p>
  
  <pre><code>    public function testB(){
      $this-&gt;browse(function ($browser) {
          $browser
              // URL:
              -&gt;visit('/login');
              // Login:
          $browser-&gt;visit(new LoginPage()){
          $this-&gt;guiLoginNormalUser($browser)
          }
          // Action:
              -&gt;assertSee("Shop");
      });
  
  
  }
  </code></pre>
  
  <p>I know the code dose not work but I am new to OOP and I don't understand how to call the method of the other class. </p>
  
  <p>I hope someone can help me.</p>
  
  <p>thanks in advance </p>
  
  <p>Janick</p>