12:40 PM PT -- Katy just took the stand and claims she never heard the song, "Joyful Noise," prior to the filing of the lawsuit. She says she first heard the beats from Dr. Luke while drinking white wine in Santa Barbara and wrote "Dark Horse" in just 4 hours. Katy remained calm throughout her testimony.
Katy Perry just arrived to an L.A. Federal Courthouse where a trial is set to take place involving her song "Dark Horse."
Perry -- wearing a mint-colored suit -- is expected to testify in the trial today in what has been a lengthy legal battle.
As we reported ... Katy was sued by Christian rapper Flame back in July 2014 after claiming Katy's 2013 hit track "Dark Horse" is a total rip-off of his Grammy-nominated gospel track "Joyful Noise." Flame's music label uploaded the music video in 2008 to YouTube and it has nearly 4 million views.
According to the suit ... Flame says Perry not only jacked their religious music ... she also destroyed his reputation in the Christian music world because they're now associated with the anti-Christian witchcraft and imagery that appears in the "Dark Horse" music video.
Flame claims Katy jacked the underlying beat ... but she's calling BS, saying there are no significant similarities.