• Laravel unit testing in workbench note

    Just want to note down my experiences when doing unit testing with Laravel.


    Use Mockery to mock all the dependencies if possible to save time when executing the tests.

    Database Testing with Sqlite (in memory)

    If the tests involve a very complex SQL query/database, then should first try to do the testing using SQLite in memory. This will speed up execution time a lot as the database will be destroyed and re-created every time a single method runs. A database running in memory will speed up the process.

    However, there are some...

    Read More
  • Composer load test package from Github

    To load package from Github for testing instead of using workbench, just need to add this to composer.json:

    1.  "repositories": [
    2.      {
    3.        "type": "vcs",
    4.        "url": "https://github.com/thehung111/Permit.git" // add the source
    5.      }
    6.    ],
    7.    "require": {
    8.      "laravel/framework": "4.1.*",
    9.      "nth/permit": "dev-master"  // add custom package
    10.    },
    Read More
  • Plenty of meetings

    School will start again next week. I am having lots of meetings this week.

    Continue my journey with Laravel framework :) Almost finish writing the draft version for Permit package. Basically, I rewrite the bitwise permission scheme used in Liferay for Laravel. Feel fun to revise some bit operations after so long. The last time I wrote bit operations are during year 3 of University for the Amazon game :) It was so tough back then.

    Hurray! almost done. The super early alpha version is here: Permit. Still need to add in a lot of unit test...

    Read More
  • So many PHP frameworks - Laravel/Symfony/Phalcon

    This year I coached students on so many competitions :)) Codextreme, Splash Awards, World Skills, Samsung. Kinda interesting. During these few days, I was trying to refresh my PHP frameworks knowledge. I am most familiar with Yii framework. However, it takes forever for Yii v2 to get ready for production usage. I also do not like the fact that it only supports PHP 5.4 onwards. It simply limits plenty of deployment options out there.

    Recently, I also had experience with Processwire CMS. It is a small but cute CMS which is quite flexible....

    Read More
  • Bluetooth headset pairing mode issue with iPhone/Macbook

    I felt so stupid. Kept trying to find out why my Macbook/iPhone cannot discover the Bluetooth headsets. Even waste money to buy 2 of them :))

    Just need to hold the headsets a bit longer: 1) For SHB4000 Phillips, have to hold the headset until it is flashing white and blue. If hold only 1s, it is flashing blue only which is not in pairing mode. 2) For Valore BT310, have to hold the headset until the red light is slightly flashing. Same issue, if the light is flashing blue only, it is not in pairing mode..


    Read More