Advertisement:

Author Topic: How use PHPUnit with Osclass ?  (Read 504 times)

AdrianOlmedo

  • Newbie
  • *
  • Posts: 46
  • Working with Osclass 3.7.5
How use PHPUnit with Osclass ?
« on: July 28, 2017, 03:38:28 am »
https://github.com/xiris/osclass-core <-- There it tells me that I can install via Composer. Honestly I've never use Composer.

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How use PHPUnit with Osclass ?
« Reply #1 on: July 28, 2017, 04:59:48 am »
i don't know anything about this fork... you should urgently install only files from original package...
https://github.com/osclass/Osclass


AdrianOlmedo

  • Newbie
  • *
  • Posts: 46
  • Working with Osclass 3.7.5
Re: How use PHPUnit with Osclass ?
« Reply #2 on: July 28, 2017, 05:10:20 am »
ok, I forget me of that repository and I use the original, how I make an unitest to a class that depend of DAO Class?

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How use PHPUnit with Osclass ?
« Reply #3 on: July 28, 2017, 06:04:17 am »
you just need to extend your class with the DAO class... then you can make use of all functions of DAO Method inside of your class...

Code: [Select]
class yourClass extends DAO {
    ...
    $this->dao->yourNeededDAOFunction();
    ...
}

AdrianOlmedo

  • Newbie
  • *
  • Posts: 46
  • Working with Osclass 3.7.5
Re: How use PHPUnit with Osclass ?
« Reply #4 on: July 28, 2017, 09:13:43 am »
I mean, within phpunit:

If I include XTBanners.php (plugin model), the console will ask for the DAO class.

How do I get: PHPUnit load all necessary files automatically?
« Last Edit: July 28, 2017, 09:24:44 am by AdrianOlmedo »